Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Boolean Object (JavaScript)

Creates a new Boolean value.

boolObj = new Boolean([boolValue])

boolObj

Required. The variable name to which the Boolean object is assigned.

boolValue

Optional. The initial Boolean value for the new object. If Boolvalue is omitted, or is false, 0, null, NaN, or an empty string, the initial value of the Boolean object is false. Otherwise, the initial value is true.

The Boolean object is a wrapper for the Boolean data type. JavaScript implicitly uses the Boolean object whenever a Boolean data type is converted to a Boolean object.

You rarely call the Boolean object explicitly.

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards. See Version Information.

Show:
© 2015 Microsoft