Skip to content

AMS FEB FT FEB - Yvana Wagter #1507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fifth commit, iterations done - bonus incomplete
  • Loading branch information
Y-VW committed Feb 18, 2020
commit c4ef95b365e1bd1511cc64ae442f024120df9497
12 changes: 12 additions & 0 deletions starter-code/src/functions-and-arrays.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,18 @@ const wordsCount = [
'matter'
];


function howManyTimes (array, word){
if (array.length === 0){
return 0;
} else {
var count = 0;
array.forEach((value) => (value === word && count++)
);
return count;
}
}

// Iteration #8: Bonus

const matrix = [
Expand Down