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

constructor Property (Boolean)

Specifies the function that creates a Boolean.

boolean.constructor([[value])

boolean

The name of the Boolean.

value

Optional. Specifies the value of the Boolean. This can be the numbers 1 or 0, or the strings "true" or "false".

The constructor property contains a reference to the function that constructs instances of the Boolean object.

The following example illustrates the use of the constructor property.

var x = new Boolean("true");

if (x.constructor == Boolean)
    document.write("Object is a Boolelan.");

// Output:
// Object is a Boolean.

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.

Show:
© 2015 Microsoft