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 e9d60c8 commit e56798cCopy full SHA for e56798c
src/functions-and-arrays.js
@@ -159,7 +159,19 @@ const wordsCount = [
159
'matter'
160
];
161
162
-function howManyTimes() {}
+function howManyTimes(words, wordToSearchFor) {
163
+ if (words.length === 0){
164
+ return 0
165
+ }
166
+
167
+ let repetitionCounter = 0
168
+ for (word of words) {
169
+ if(word === wordToSearchFor){
170
+ repetitionCounter++
171
172
173
+ return repetitionCounter
174
+}
175
176
177
0 commit comments