The Class Register
JavaScript
20 pts
The Class Register
The array students holds one object per student. Then:
- Add Ruta (score 79) to the end with
push()— push an object. - Write
average(list)that returns the mean of allscorevalues. - Write
best(list)that returns the student object with the highest score. - Print the number of students, the average and the best student.
Expected output:
Students: 5 Average: 83 Best: Senait (95)
Checklist
- Add Ruta’s object to the array.
- Write
average(list). - Write
best(list)returning the best student object. - Print the three lines.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
