This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

constructor

Summary

Initializes a Boolean object.

Syntax

boolean.constructor([ value ])
boolean
Required. The name of the Boolean object being created
value
Optional. Specifies the value of the Boolean object. This can be the numbers 1 or 0, or the strings “true” or "false".

Examples

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.

Remarks

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

See also

Specification

15.6 Boolean Objects ECMAScript® Language Specification Standard ECMA-262 5.1 Edition / June 2011

Attributions

  • Microsoft Developer Network: Article