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

The **`toString()`** method returns a string representing the specified boolean value.

## Syntax

```js
toString()
```

### Return value

A string representing the specified boolean value.

## Description

The `Boolean` object overrides the `toString` method of `Object`; it does not inherit
[`Object.prototype.toString()`](../../Object/prototype/toString.mdx). For `Boolean` values, the `toString` method returns a string representation of the boolean value, which is either `"true"` or `"false"`.

The `toString()` method requires its `this` value to be a `Boolean` primitive or wrapper object. It throws a [`TypeError`](../../../globals/TypeError/TypeError.mdx) for other `this` values without attempting to coerce them to boolean values.

Because `Boolean` doesn't have a [`[Symbol.toPrimitive]()`](../../Symbol/toPrimitive.mdx) method, JavaScript calls the `toString()` method automatically when a `Boolean` _object_ is used in a context expecting a string, such as in a [template literal](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Template_literals). However, boolean _primitive_ values do not consult the `toString()` method to be [coerced to strings](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) — rather, they are directly converted using the same algorithm as the initial `toString()` implementation.

```js
Boolean.prototype.toString = () => "Overridden";
console.log(`${true}`); // "true"
console.log(`${new Boolean(true)}`); // "Overridden"
```
