Skip to content

Instantly share code, notes, and snippets.

@joepie91
Last active July 9, 2017 11:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save joepie91/5fd8c58345998d4dec5b to your computer and use it in GitHub Desktop.
Boolean casting in Node.js
> !!(false)
false
> !!(0)
false
> !!("")
false
> !!(null)
false
> !!(undefined)
false
> !!("0")
true
> !!("test")
true
> !!(-1)
true
> !!(true)
true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment