JavaScript Truthy_falsy Guide
Truthy and falsy rules determine how JavaScript values coerce in boolean contexts like if conditions and logical operators. The guide walks through Truthy & Falsy. Falsy values: false, 0, -0, 0n, "", null, undefined, NaN. All others are truthy: "0", "false", [], {}, Infinity. Boolean() or !! converts any value: `!!"hello"` — true. `Boolean(0)` — false. Logical && and || work with truthy/falsy values, not only returning booleans. The guide is organized into 1 sections that build on each other, each pairing a prose explanation with runnable code. Related guides: Arrays, Strings, Numbers, Math, Date. This is one of 145 JavaScript guides on JS Reference — see the full list on the guides page. Practice what you learn in the JavaScript playground, and look up any unfamiliar term in the JavaScript glossary.