FrontendInterviews.dev

642. Symbol Keys and JSON.stringify

Easy•

Predict the output.

const k = Symbol("id")
const obj = { [k]: 1, name: "A" }
console.log(JSON.stringify(obj))

What is printed in the console?

Select an option and submit your answer.
Next Problem