JavaScript Boolean toString() method
- Previous Page
- Next Page
- Go to the Previous Level JavaScript Boolean Reference Manual
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"
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 |
- Previous Page
- Next Page
- Go to the Previous Level JavaScript Boolean Reference Manual