There are five falsey values in JavaScript: undefined is…
““There are five falsey values in JavaScript: undefined is falsey. null is falsey. 0 is falsey. The empty string is falsey. NaN is falsey.””
About This Quote
This interpretation was drafted with AI assistance. It is one reading of the quote, not the author's own explanation.
JavaScript treats several values as false in conditionals, including undefined, null, 0, empty string, and NaN.
In simple terms: These five values evaluate to false.
Remember these falsey values when writing conditionals.
Themes
Mood
Type
When to use this quote
- debugging
- code reviews
- teaching JavaScript
- writing tutorials
Key Concepts
Questions to Reflect On
- How do falsey values affect your code flow?
- Can you rely on truthiness for safety checks?
Only these five are falsey; other falsy values exist in other languages.