Tell us what’s happening:
Hello, I have the expected result but the console tells me that I must obtain 71.7 for example, but I display 71.7 so I don’t understand.
Your code so far
// User Editable Region
function getAverage(a, b, c, d, e, f, g, h, i, j) {
return (a + b + c + d + e + f + g + h + i + j) / getAverage.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));
console.log(getAverage(38, 99, 87, 100, 100, 100, 100, 100, 100, 100));
// User Editable Region
// running tests
2. getAverage([92, 88, 12, 77, 57, 100, 67, 38, 97, 89]) should return 71.7.
3. getAverage([45, 87, 98, 100, 86, 94, 67, 88, 94, 95]) should return 85.4.
4. getAverage([38, 99, 87, 100, 100, 100, 100, 100, 100, 100]) should return 92.4.
5. Your getAverage function should return the average score of the test scores.
// tests completed
// console output
71.7
85.4
92.4
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Challenge Information:
Review JavaScript Fundamentals by Building a Gradebook App - Step 1