Falsy Values: The Complete List
You'll learn the exact six values in JavaScript that are treated as false in boolean contexts.
The Six Falsy Values
In JavaScript, there are exactly six values that evaluate to false when converted to a boolean. Every other value is truthy. This is a fixed list worth memorizing:
false— the boolean literal itself0— the number zero (also-0)""— the empty string (also''or``)null— represents intentional absence of valueundefined— uninitialized or missing valueNaN— Not a Number (result of invalid math)
Why This Matters
When you use values in conditional contexts (like if statements), JavaScript automatically converts them to booleans. Knowing these six falsy values means you know when something will behave as false.
// All of these will NOT execute the console.log:
if (false) { console.log("Won't run"); }
if (0) { console.log("Won't run"); }
if ("") { console.log("Won't run"); }
if (null) { console.log("Won't run"); }
if (undefined) { console.log("Won't run"); }
if (NaN) { console.log("Won't run"); }
Memory Trick
Think of it as "F-0-E-N-U-N": False, 0, Empty string, Null, Undefined, NaN.
Everything else—including "0", "false", empty arrays [], and empty objects {}—is truthy!
Key Takeaway: JavaScript has exactly six falsy values: false, 0, "" (empty string), null, undefined, and NaN. Memorize this list—it's fundamental to understanding boolean conversion.