Skip to content
This repository was archived by the owner on Oct 26, 2020. It is now read-only.

Dan carter week 3 #76

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
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
completed mandatory 4
  • Loading branch information
carterd888 committed Jul 2, 2020
commit faa340f83400381b215f4c3619ec6dd106656156
12 changes: 10 additions & 2 deletions week-3/2-mandatory/4-eligible-students.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@
- Returns an array containing only the names of the who have attended AT LEAST 8 classes
*/

function eligibleStudents() {
//nested array [0] name [1] attendance, return array with just index [0] if [1] is >= 8
function eligibleStudents(arr) {
let newArr = [];
for(let i= 0; i < arr.length; i++) {
if (arr[i][1] >= 8) {
newArr.push(arr[i][0]);
}
} return newArr;
};


}

/* ======= TESTS - DO NOT MODIFY ===== */

Expand Down