DEV Community

Discussion on: JavaScript Memes and Jokes ... Keep em coming 😁

Collapse
 
shuvalov_js profile image
Senior JavaScript Artist Anton • Edited

{} + [] is the most stupid thing people joking about JS ever. Actually, the behavior is the same like for []+{} — it's calling toValue(), but in the CLI/browser console, when you're writing an expression starts from from {}, it actually means not an object, but a block, that means empty instructions set to compiler in this context. So the expression is just '+[]'.

Thread Thread
 
sharadcodes profile image
Sharad Raj (He/Him)

Some serious art stuff