Skip to content

Commit f3c50dc

Browse files
committed
Iteration ironhack-labs#7: Count repetition
1 parent ad1fa96 commit f3c50dc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

starter-code/src/functions-and-arrays.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ const wordsCount = [
109109
'disobedience',
110110
'matter'
111111
];
112+
function howManyTimes( wordsArr, wordSearch ) {
113+
return wordsArr.filter( elm => elm === wordSearch).length
114+
}
112115

113116
// Iteration #8: Bonus
114117

0 commit comments

Comments
 (0)