cf.completefrontend

Predict the outputMedium

Which of these operations see a symbol-keyed property?

What does this log?
const id = Symbol("id");
const user = { name: "Ada", [id]: 42 };
 
console.log(Object.keys(user));
console.log(JSON.stringify(user));
for (const key in user) console.log(key);
console.log(Object.getOwnPropertySymbols(user));
console.log({ ...user }[id]);
console.log(JSON.stringify({ tag: Symbol("x") }), JSON.stringify([Symbol("x")]));

The answer

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

Checking your sign-in…