Number() (Constructor)

A Number object constructor.


ECMAScript edition - 2
JavaScript - 1.1
JScript - 1.0
Internet Explorer - 3.02
Netscape - 3.0
Property/method value type:Number object
JavaScript syntax:-new Number()
-new Number(aValue)>
Argument list:aValueA value to be converted to a Number object.

The Number() constructor is used to manufacture a new instance of the built-in Number object converting the input value to a number as it instantiates the new object.

The value of the Number object when the constructor is called in a new expression is the same as value yielded by the type conversion function call.

Refer to the Number() Function topic for a table of rules for converting non-number values to Number objects.

The result is a Number object whose value is equivalent to the that of the passed-in argument. If the value is omitted, the Number object will assume a value of 0.


See also:Constructor function, constructor property, Global object, new, Number.prototype, Object constant, Object()


ECMA 262 edition 2 - section -

ECMA 262 edition 2 - section - 15.7.1

ECMA 262 edition 2 - section -

ECMA 262 edition 3 - section - 15.7.2