cf.completefrontend

Predict the outputEasy

What do at() and bracket access return for these indexes?

What does this log?
const scores = [10, 20, 30];
 
console.log(scores.at(-1), scores[-1]);
console.log(scores.at(0), scores.at(3), scores.at(-4));
console.log(scores.at(1.9), scores.at("2"));
console.log("hello".at(-1));
 
scores[-1] = 99;
console.log(scores.length, scores.at(-1));

The answer

Work out every line it logs, in order. Then check.

Checking your sign-in…