FrontendInterviews.dev

606. Object Key Coercion Trap

Easy•

Predict the output.

const obj = {}
obj[1] = 'number'
obj['1'] = 'string'
console.log(obj[1])

What does console.log(obj[1]) print?

Select an option and submit your answer.
Next Problem