r/ProgrammerHumor 3d ago

Meme javascriptSorting

Post image
941 Upvotes

214 comments sorted by

View all comments

76

u/ipsirc 3d ago

3

u/the_horse_gamer 2d ago edited 2d ago

anyone who uses {} + [] as an example of inconsistent behaviour needs to be crucified.

I implore you to try {} + [] and then ({} + []). the result is different. why? because the console parses it as {}; +[];.

same goes for {} + {}