denysdovhan / wtfjs

🤪 A list of funny and tricky JavaScript examples
http://bit.ly/wtfjavascript
Do What The F*ck You Want To Public License
34.95k stars 2.55k forks source link

updated explanation for why {} + [] differs from [] + {} #150

Closed EmNudge closed 4 years ago

EmNudge commented 4 years ago

It is not a case of concatenation, but rather {} being interpreted as a code block rather than an empty object.

denysdovhan commented 4 years ago

Thanks for contributing!