JavaScript Boolean toString() method

Definition and usage

Boolean.toString() method to return the boolean value as a string.

When a boolean value is used in string operations, JavaScript will automatically call Boolean.toString().

Example

Convert boolean value to string:

let bool = true;
bool.toString()    // Returns "true"

Try it yourself

Syntax

boolean.toString()

Parameter

No parameters.

Technical details

Return value: String, "true" or "false".
JavaScript Version: ECMAScript 1

Browser Support

All Browsers Fully Support Boolean.toString() Method:

Chrome IE Edge Firefox Safari Opera
Chrome IE Edge Firefox Safari Opera
Support Support Support Support Support Support

Related Pages

Tutorial:JavaScript Boolean

Tutorial:JavaScript Data Types