toString() method
Convert Boolean value to string and return the result.
Example
Convert boolean to string:
1 2 |
|
Output result:
1 |
|
Definition and usage
The toString() method converts a logical value to a string and returns the result.
Note: JavaScript will automatically call this method when you need to convert a Boolean object into a string.
Grammar
1 |
|
Return value
"true" or "false"
1 2 |
|
Output result:
1 |
|
Grammar
1 |
|
Return value
"true" or "false"