Reading an index that does not exist produces undefined.
const names = ["Ava"];
console.log(names[3]); // outputs undefinedPredict the output
A scoreboard tries to display the final player's score. Trace how it chooses the index and predict the output.
const scores = [8, 10];
console.log("Final score:", scores[scores.length]);