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

JavaScript constructor Property

JavaScript constructor Property

Number Object Reference JavaScript Number object

Example

Return a reference to the Number function that created this object:

num.constructor;

Output result:

function Number() { [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

number

.constructor

Technical Details

Return Value: A function object. A reference to the Number function that created this object
JavaScript version: 1.1

Number Object Reference JavaScript Number object