Please consider indenting your code properly as it will help you find bugs like the one you have right now. Here’s the correct indentation:
function getAverage(scores) {
for(let i = 0; i < scores.length; i++);
sum += scores[i];
}
return sum/scores.length;
I pushed the code within the function 2 spaces to the right.
I also pushed the code within the for 2 more spaces to the right.
Now looking at this correctly indented code. Do you notice anything is missing?
(what should the last line of this function have? what about the for loop statement? It is also missing something important at the end of the line - the semicolon doesn’t belong there)
I think you missed that the for loop is actually empty, there is a semicolon finishing the for loop, and there are no curly brackets for the for loop block