Convert a Boolean value to a string:
The result of myvar will be:
The toString() method converts a Boolean value to a string, and returns the result.
Note: This method is called by JavaScript automatically whenever a Boolean object is used in a situation requiring a string.
![]()
The toString() method is supported in all major browsers.
| Type | Description |
|---|---|
| String | Either "true" or "false" |
| JavaScript Version: | 1.1 |
|---|
JavaScript Boolean Object
Your message has been sent to W3Schools.