Skip to content

Instantly share code, notes, and snippets.

@sophiabrandt
Created February 18, 2019 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sophiabrandt/fb52648db448a80c3ceced9d5d6f8dde to your computer and use it in GitHub Desktop.
Save sophiabrandt/fb52648db448a80c3ceced9d5d6f8dde to your computer and use it in GitHub Desktop.
Truthy and Falsy Values in JavaScript, Python and Clojure/ClojureScript
JavaScript Python 3 Clojure/ClojureScript
Falsy false False false
null None nil
NaN
undefined
0 (zero) 0
0.0 0.0
"" (empty string) "" (empty string)
[] (empty list)
() (empty tuple)
{} (empty dict)
set() (empty set)
b'' (empty byte)

Everything else is truthy.

@FernandoMSoares
Copy link

Thank you for this! :) Really useful

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