Skip to content

Instantly share code, notes, and snippets.

@mde
Created June 8, 2011 03:00
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mde/1013691 to your computer and use it in GitHub Desktop.
Save mde/1013691 to your computer and use it in GitHub Desktop.
js> isNaN(null);
false
js> null > -1;
true
js> null < 1;
true
js> null > 0;
false
js> null < 0;
false
js> null == 0;
false
@mde
Copy link
Author

mde commented Jun 8, 2011

@millermedeiros I was confused the same way with parseInt, but I guess it made a little more sense to me that explicit conversions might behave different from implicit coercions. That's why the double-equal thing seemed particularly weird. @BrendanEich Thanks for chiming in with some context and history on this. :)

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