Skip to content

Commit 4ab6f6e

Browse files
added comment to iteration ironhack-labs#7
1 parent 523ba7e commit 4ab6f6e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/functions-and-arrays.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ function uniquifyArray(array) {
255255
}
256256
}
257257

258+
// run function
259+
uniquifyArray(wordsUnique);
260+
258261

259262
// ----------------------------------------
260263
// Iteration #6: Find elements
@@ -293,10 +296,9 @@ const wordsCount = [
293296
'matter'
294297
];
295298

299+
// return number of occurences of search word
296300
function howManyTimes(array, searchWord) {
297-
298301
let wordCount = 0;
299-
300302
for (let i = 0; i < array.length; i++) {
301303
if(array[i] == searchWord) {
302304
wordCount++;
@@ -306,6 +308,9 @@ function howManyTimes(array, searchWord) {
306308
return wordCount;
307309
}
308310

311+
// run function
312+
howManyTimes(wordsCount, 'matter');
313+
309314

310315
// ----------------------------------------
311316
// Iteration #8: Bonus

0 commit comments

Comments
 (0)