cf.completefrontend

Predict the outputEasy

What does this log when objects are used as property keys?

What does this log?
const cache = {};
const a = { id: "a" };
const b = { id: "b" };
 
cache[a] = 123;
cache[b] = 456;
 
console.log(cache[a]);
console.log(Object.keys(cache));
 
const scores = {};
scores[1] = "one";
scores["1"] = "uno";
console.log(scores[1], Object.keys(scores));

The answer

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

Checking your sign-in…