JavaScript · Senior · Question 62 of 75
What does [] + {} evaluate to?
- ✓Correct answer:
"[object Object]" - 2
0 - 3
NaN
Explanation
+ converts both operands to primitives: [] becomes "" and {} becomes "[object Object]", then strings are concatenated. Such coercions are why linters warn about mixed-type +.