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 b471925 commit 7733e5eCopy full SHA for 7733e5e
src/functions-and-arrays.js
@@ -198,9 +198,23 @@ const wordsCount = [
198
'disobedience',
199
'matter'
200
];
201
+let theWord2 = 'subset';
202
-function howManyTimes() {}
203
-
+function howManyTimes(wordsCount, theWord2) {
204
+ let theAnswer = false
205
+ let theCounter = 0
206
+ if (theWord === '' || wordsCount.length === 0) {
207
+ return theCounter
208
+ } else {
209
+ for (let i=0; i < wordsCount.length; i++) {
210
+ if (theWord2 === wordsCount[i]) {
211
+ theAnswer = true
212
+ theCounter += 1
213
+ }
214
215
216
217
+}
218
219
220
// Iteration #8: Bonus
0 commit comments