Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

JavaScript Boolean constructor Property

JavaScript Boolean constructor Property

Boolean Object Reference JavaScript Boolean object

Example

Returns via myvar The function that created the object's prototype:

var myvar = new Boolean(1);

myvar.constructor;

Result output:

function Boolean() { [native code] }

Try it »


Definition and Usage

The constructor property returns a reference to the Boolean function that created this object.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the constructor property.


Syntax

boolean

.constructor

Technical Details

Return Value: A function object. Returns the function prototype that created the Boolean object.
JavaScript version: 1.1

Boolean Object Reference JavaScript Boolean object