Hi there, just failed one thing in my exam, but have no idea what is wrong with the function. It suppose to add any student with gpa higher than 3.5. this is my solution.
const students = [{
name: "Paisley Parker",
gpa: 4.0
},
{
name: "Lake Herr",
gpa: 3.2
},
{
name: "Promise Lansing",
gpa: 3.9
},
{
name: "Friar Park",
gpa: 2.8
},
{
name: "Mason Amitie",
gpa: 3.49
}
]
function getDeansList(studentList) {
let deansList = [];
for (i = 0; i < studentList.length; i++) {
if (studentList.gpa > 3.5) {
deansList.push(i);
}
}
return deansList
}
console.log(getDeansList(students))