JavaScript Boolean Guide
The Boolean object wraps the boolean primitive type. While booleans are simple, understanding truthiness and falsiness is crucial in JavaScript. The guide walks through The Boolean Object, Falsy Values, Type Coercion. `new Boolean(value)` creates a Boolean object (avoid — it behaves unexpectedly). `Boolean(value)` as a function converts any value to a primitive boolean. Double negation `!!value` is a common shorthand. Only 6 falsy values exist: `false`, `0`, `""` (empty string), `null`, `undefined`, `NaN`. Everything else is truthy, including `"false"`, `[]` (empty array), and `{}` (empty object). The guide is organized into 3 sections that build on each other, each pairing a prose explanation with runnable code. Browse the individual methods covered by this guide in the Boolean category. Key APIs covered include Boolean(), Boolean.prototype.toString(), Boolean.prototype.valueOf(). 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.