toString Method (Boolean) 1

Returns a string representation of an object.

Syntax


boolean.toString()  

Parameters

boolean
Required. An object for which to get a string representation.

Return Value

If the Boolean value is true, returns "true". Otherwise, returns "false".

Remarks

Example

The following example illustrates the use of the toString method.

var s = new Boolean(0);  
document.write(s.toString());  

// Output: false;  

Requirements

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported Store apps (Windows 8 and Windows Phone 8.1). See Version Information.