numObj = new Number(value)
Required. The variable name to which the
Number object is assigned.
Required. The numeric value.
Number objects when a variable is set to a number value, for example
var num = 255.336;. It is seldom necessary to create
Number objects explicitly.
Number object has its own properties and methods, in addition to the properties and methods inherited from
Object. Numbers are converted into strings under certain circumstances, for example when a number is added or concatenated with a string, as well as by means of the
toString method. For more information, see Addition Operator (+).
Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported in Store apps (Windows 8 and Windows Phone 8.1). See Version Information.
The following table lists the properties of the
|constructor Property||Specifies the function that creates an object.|
|prototype Property||Returns a reference to the prototype for a class of objects.|
The following table lists the functions of the
|Number.isFinite Function||Returns a Boolean value that indicates whether a value is finite.|
|Number.isInteger Function||Returns a Boolean value that indicates whether a value is an integer.|
|Number.isNaN Function||Returns a Boolean value that indicates whether a value is the reserved value
The following table lists the methods of the
|hasOwnProperty Method||Returns a Boolean value that indicates whether an object has a property with the specified name.|
|isPrototypeOf Method||Returns a Boolean value that indicates whether an object exists in another object's prototype hierarchy.|
|propertyIsEnumerable Method||Returns a Boolean value that indicates whether a specified property is part of an object and whether it is enumerable.|
|toExponential method||Returns a string that contains a number represented in exponential notation.|
|toFixed method||Returns a string that represents a number in fixed-point notation.|
|toLocaleString Method||Returns an object converted to a string based on the current locale.|
|toPrecision method||Returns a string that contains a number that is represented in either exponential or fixed-point notation and that has a specified number of digits.|
|toString Method||Returns a string representation of an object.|
|valueOf Method||Returns the primitive value of the specified object.|