Beginner
Class report with filter, sort and reduce
Write report(students), where students is an array of { name, score } objects. Return an object with two properties:
passed: the names of students who scored 40 or more, sorted A to Z.
average: the average score of all students, rounded to a whole number with Math.round. For an empty array, the average is 0.
Don't change or reorder the students array.
What Check tests
passedlists the names with 40 or more, A to Z- A score of exactly 40 passes
averageis the rounded average of all scores- An empty class gives no names and an average of 0
- The students array is not reordered
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.