Skip to content

Instantly share code, notes, and snippets.

@grownseed
Created March 29, 2013 23:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grownseed/5274302 to your computer and use it in GitHub Desktop.
Save grownseed/5274302 to your computer and use it in GitHub Desktop.
{} + [] >>> 0
parseInt({} + []) >>> NaN
!{} > ~{} >>> true
~[] >>> -1
{} + 0 + [] >>> "0"
0 + {} + [] >>> "0[object Object]"
{} + [] + 0 >>> 0
typeof null === 'object' && null !== undefined && null == undefined >>> true
@bencevans
Copy link

@grownseed I recommend (if you've not already seen it) https://www.destroyallsoftware.com/talks/wat on the same sort of thing in Ruby & JS

@BrentNoorda
Copy link

x = new Boolean(false); x == !x; >>> true

@grownseed
Copy link
Author

@bencevans I saw that talk, forgot about it, thanks for reminding me, lots of fun :)
@BrentNoorda pretty cool! Also the reason why I never use the Boolean constructor ^^

Keep them coming, I find that stuff really amusing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment