☬
Size: a a a
☬
DM
DM
Nn
☬
NB
const students = [
{
id: 10,
name: 'John Smith',
marks: [10, 8, 6, 9, 8, 7]
},
{
id: 11,
name: 'John Doe',
marks: [ 9, 8, 7, 6, 7]
},
{
id: 12,
name: 'Thomas Anderson',
marks: [6, 7, 10, 8]
},
{
id: 13,
name: 'Jean-Baptiste Emanuel Zorg',
marks: [10, 9, 8, 9]
}
];
const getStudentAverage = id => {
const studentById = students.find(student => student.id === id)
const studentMarks = studentById.marks
return studentMarks.reduce((acc, mark) => acc + mark, 0) / students.length
}
getStudentAverage(10)
return students.map((item) => {return averageStudentMark(item.id)}) / students.length
Nn
🍻
JD
🍻
☬
JD
🍻
JD
🍻
JD
🍻
🍻
ЖЧ
<html>
<body>
</body>
</html>
j
return students.map((item) => {return averageStudentMark(item.id)}) / students.length