Skip to content

Commit 5ce4f2c

Browse files
committed
Code of iteration ironhack-labs#4 and ironhack-labs#5
1 parent 8da78e8 commit 5ce4f2c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/functions-and-arrays.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,18 @@ const wordsUnique = [
8787
'bring'
8888
];
8989

90-
function uniquifyArray() {}
90+
function uniquifyArray(arrayOfWords) {
91+
let newArray = [];
92+
93+
for (let i=0; i<arrayOfWords.length; i++){
94+
if (newArray.indexOf(arrayOfWords[i]) === -1) {
95+
newArray.push(arrayOfWords[i]);
96+
97+
}
98+
}
99+
return newArray;
100+
}
101+
uniquifyArray(wordsUnique);
91102

92103

93104

0 commit comments

Comments
 (0)