We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80246dc commit 24837acCopy full SHA for 24837ac
src/functions-and-arrays.js
@@ -119,7 +119,22 @@ const wordsUnique = [
119
'bring'
120
];
121
122
-function uniquifyArray() {}
+function uniquifyArray(arrOfWords) {
123
+
124
+ if (arrOfWords.length === 0) return null;
125
126
+ let uniqeArray = [];
127
+ let wordCounter = 1;
128
129
+ arrOfWords.forEach(word => {
130
+ if (!uniqeArray.includes(word)) {
131
+ uniqeArray.push(word);
132
+ }
133
+ });
134
135
+ return uniqeArray.length === arrOfWords ? arrOfWords : uniqeArray;
136
137
+}
138
139
140
0 commit comments