Number.constructor (Property)

A reference to a constructor object.


ECMAScript edition - 2
JavaScript - 1.1
JScript - 1.0
Internet Explorer - 3.02
Netscape - 3.0
Property/method value type:Number object
JavaScript syntax:-myNumber.constructor

The initial value of the Number constructor is the built in Number object.

You can use this as one way of creating number objects although it is more popular to use the new Number() technique.

This property is useful if you have an object that you want to clone but you don't know what sort of object it is. Simply access the constructor belonging to the object you have a reference to.

Netscape provides constructors for many objects, virtually all of them in fact, even when it is highly inappropriate to do so. MSIE is far more selective, and there are some occasions when you might wish for a constructor that is not available in MSIE.

See also:Number.MAX_VALUE, Number.MIN_VALUE, Number.NaN, Number.NEGATIVE_INFINITY, Number.POSITIVE_INFINITY, Number.prototype


ECMA 262 edition 2 - section - 15.7.2

ECMA 262 edition 3 - section - 15.7.2