JavaScript Programmer’s Reference Method JavaScript (Web hosting services) JScript N IE
JavaScript Programmer’s Reference Method JavaScript JScript N IE Opera NES ECMA Notes toExponential() 1.5 + 5.5 + 6.0 + 5.5 + 3 + - toFixed() 1.5 + 5.5 + 6.0 + 5.5 + 3 + - toLocaleString() 1.5 + 5.5 + 6.0 + 5.5 + 3 + Warning toPrecision() 1.5 + 5.5 + 6.0 + 5.5 + 3 + - toSource() 1.3 + 4.06 + 3 + - toString() 1.1 + 1.0 + 3.0 + 3.02 + 3.0 + 2 + - valueOf() 1.1 + 3.0 + 3.0 + 4.0 + 2 + - Cross-references: ECMA 262 edition 2 section 4.3.20 ECMA 262 edition 2 section 10.1.5 ECMA 262 edition 2 section 15.7 ECMA 262 edition 3 section 4.3.21 ECMA 262 edition 3 section 10.1.5 ECMA 262 edition 3 section 15.7 Wrox Instant JavaScript page 33 Number() (Constructor) A Number object constructor. Availability: ECMAScript edition 2 JavaScript 1.1 JScript 1.0 Internet Explorer 3.02 Netscape 3.0 Property/method value type: Number object -new Number()JavaScript syntax: -new Number(aValue) Argument list: aValue A 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 Numberobject 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.