Hello i think i did everything good but i still didn’t get the result that show in console .
My console show :
71.7
157.1
The first result is true but the second is not why is that ? Please help its been 6 hours my head is killing me
let sum = 0;
function getAverage(scores) {
for (let i = 0; i < scores.length; i++) {
sum += scores[i];
}
return sum / scores.length;
}
console.log(getAverage([92, 88, 12, 77, 57, 100, 67, 38, 97, 89]));
console.log(getAverage([45, 87, 98, 100, 86, 94, 67, 88, 94, 95]));