Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The Boolean() constructor creates Boolean objects. When called as a function, it returns primitive values of type Boolean.
Note: Boolean() can be called with or without new, but with different effects. See Return value.
The initial value of the Boolean object.
When Boolean() is called as a function (without new), it returns value coerced to a boolean primitive.
When Boolean() is called as a constructor (with new), it coerces value to a boolean primitive and returns a wrapping Boolean object, which is not a primitive.
Warning: You should rarely find yourself using Boolean as a constructor.
The value passed as the first parameter is converted to a boolean value. If the value is omitted or is 0, -0, 0n, null, false, NaN, undefined, or the empty string (""), then the object has an initial value of false. All other values, including any object, an empty array ([]), or the string "false", create an object with an initial value of true.
Note: When the non-standard property document.all is used as an argument for this constructor, the result is a Boolean object with the value false. This property is legacy and non-standard and should not be used.
Note how converting a Boolean object to a primitive with Boolean() always yields true, even if the object holds a value of false. You are therefore always advised to avoid constructing Boolean wrapper objects.
If you need to take the primitive value out from the wrapper object, instead of using the Boolean() function, use the object's valueOf() method instead.
| ECMAScript® 2027 Language Specification # sec-boolean-constructor |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 10, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.