Skip to content

Commit 90b0ac0

Browse files
author
Rita Mernissi
committed
3 remaining failures
1 parent 66e92bf commit 90b0ac0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,18 @@ var wordsCount = [
147147
'disobedience',
148148
'matter'
149149
];
150+
151+
function howManyTimes(array, word){
152+
if (array == 0) return false;
153+
var count = 0;
154+
for (var i=0; i < array.length; i++) {
155+
if (array[i] == word) {
156+
count = count + 1;
157+
}
158+
}
159+
return count;
160+
}
161+
150162
// Bonus Quest
151163

152164
var matrix = [

0 commit comments

Comments
 (0)