Frontend
Interviews
.dev
Problems
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?
number
string
undefined
TypeError
Submit Answer
Reveal Answer
Select an option and submit your answer.
Next Problem
Auto-advance on correct answer