Description
The toString() method is used to convert a Boolean value to a string and return the result.
This method has the form:
boolean.toString()
Note: This method is called by JavaScript automatically whenever a Boolean object is used in a situation requiring a string.
Return Value
A String with the value either "true" or "false"
Examples
The following example shows the basic use of this method.
<script>
var bool = new Boolean(1);
document.write(bool.toString());
</script>
This produces the following result:
Browser Support
Firefox | IE | Chrome | Opera | Safari |
---|---|---|---|---|