Skip to content

Commit 6b82e3b

Browse files
committed
Added the last Iteration ironhack-labs#7
1 parent 61995f1 commit 6b82e3b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/functions-and-arrays.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,18 @@ const wordsCount = [
160160
'matter'
161161
];
162162

163-
function howManyTimes() {}
163+
function howManyTimes(wordsCount, searchWord) {
164+
let totalApear=0;
164165

166+
for(let c of wordsCount){
167+
if(searchWord===c){
168+
totalApear+=1;
169+
}
170+
} console.log(totalApear);
171+
172+
}
165173

174+
howManyTimes(wordsCount, 'matter');
166175

167176
// Iteration #8: Bonus
168177
const matrix = [

0 commit comments

Comments
 (0)