---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# Boolean()

The **`Boolean()`** constructor can create `Boolean` objects or return primitive values of type boolean.

## Syntax

```js
new Boolean(value)
Boolean(value)
```

> **Note:** `Boolean()` can be called with or without `new`, but with different effects. See [Return value](#return-value).

### Parameters

- `value`
  - : The initial value of the `Boolean` object.

### Return value

When `Boolean()` is called as a constructor (with `new`), it creates a `Boolean` object, which is **not** a primitive.

When `Boolean()` is called as a function (without `new`), it coerces the parameter to a boolean primitive.

> **Warning:** You should rarely find yourself using `Boolean` as a constructor.

## Description

The value passed as the first parameter is [converted to a boolean value](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion). If the value is omitted or is `0`, `-0`, `0n`, [`null`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/null), `false`, [`NaN`](../NaN.mdx), [`undefined`](../undefined.mdx), 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`](https://developer.mozilla.org/docs/Web/API/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.
