JavaScript Boolean.toString()
Example
Convert a Boolean value to a string:
let bool = true;
bool.toString() // Returns "true"
Try it Yourself »
Definition and Usage
The Boolean.toString() method returns a boolean value as a string.
The Boolean.toString() is called by JavaScript automatically whenever a boolean is used in a
string operation.
Browser Support
Boolean.toString() is fully supported in all browsers:
| Chrome | IE | Edge | Firefox | Safari | Opera |
| Yes | Yes | Yes | Yes | Yes | Yes |
Syntax
boolean.toString()
Parameters
| None. |
Technical Details
| Return Value: | A String, either "true" or "false" |
|---|---|
| JavaScript Version: | ECMAScript 1 |
Related Pages
JavaScript Tutorial: JavaScript Booleans
JavaScript Tutorial: JavaScript Data Types

