Texts: On submission, transfer your code and output (screenshot) to a WORD document and submit the document in either DOCX or PDF.
JavaScript Array.prototype provides a number of iteration methods that can solve problems with JavaScript Array objects, and these functions are designed to be generally applicable to all objects that "look like" Arrays, without actually implementing the logic in a general cycle.
let stus = [
{ id: 'tp001', asgn: 13, lab: 26, exam: 40 },
{ id: 'tp002', asgn: 14, lab: 21, exam: 36 },
{ id: 'tp003', asgn: 7, lab: 13, exam: 26 },
{ id: 'tp004', asgn: 5, lab: 17, exam: 21 },
{ id: 'tp005', asgn: 18, lab: 28, exam: 43 }
]
Given the above array of stus objects, write a functional JavaScript arrow function code for:
i) To get multiple stus from an array that match a condition: stu.asgn >= 10, stu.lab >= 15, and stu.exam >= 25 [2 marks]
ii) To create a new stu.total by summing the stu.asgn, stu.lab, and stu.exam [2 marks]
iii) To create a new grade by classifying stus into three groups based on their total.
- Distinction: total 80 and above
- Pass: total between 79 to 50
- Fail: total 50 and below
[2 marks]
iv) To sort the stus based on their total in descending order [2 marks]
v) To find the mean of the stus (the whole class) based on their total. [2 marks]