Skip to content

Instantly share code, notes, and snippets.

@i
Created March 30, 2014 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save i/9878235 to your computer and use it in GitHub Desktop.
Save i/9878235 to your computer and use it in GitHub Desktop.
JavaScript fallacy
if ('0')
console.log("'0' is true")
if (0)
console.log("0 is true")
else
console.log("0 is false")
if ('0' == 0)
console.log("'0' is 0")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment