Skip to content

Instantly share code, notes, and snippets.

@FernandoMSoares
Forked from sophiabrandt/truthy-falsy.md
Created October 23, 2019 19:09
Show Gist options
  • Save FernandoMSoares/cdc9689c32d75df6b7bd9f191979e861 to your computer and use it in GitHub Desktop.
Save FernandoMSoares/cdc9689c32d75df6b7bd9f191979e861 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.

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