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 4bed2d4 commit 89044a7Copy full SHA for 89044a7
src/functions-and-arrays.js
@@ -194,7 +194,18 @@ const wordsCount = [
194
'matter'
195
];
196
197
-function howManyTimes() {}
+function howManyTimes(array, word) {
198
+ if (array.length === 0){
199
+ return 0
200
+ }
201
+ let counterWord = 0
202
+ for(let i = 0; i < array.length; i++){
203
+ if (array[i] === word){
204
+ counterWord += 1
205
206
207
+ return counterWord
208
+}
209
210
211
0 commit comments