From http://www.w3schools.com (Copyright Refsnes Data)

JavaScript toString() Method


Boolean Object Reference JavaScript Boolean Object

Definition and Usage

The toString() method converts a Boolean value to a string and returns the result.

Syntax

booleanObject.toString()


Tips and Notes

Note: This method is called by JavaScript automatically whenever a Boolean object is used in a situation requiring a string.


Example

Example

In this example we will create a Boolean and then convert it to a string:

<script type="text/javascript">

var boo = new Boolean(true);
document.write(boo.toString());

</script>

The output of the code above will be:

true

Try it yourself »


Boolean Object Reference JavaScript Boolean Object

From http://www.w3schools.com (Copyright Refsnes Data)