Menu

JAVASCRIPT TUTORIALS - Javascript - Number

Javascript - Number

ADVERTISEMENTS


var val = new Number(number);

ADVERTISEMENTS

PropertyDescription
MAX_VALUEThe largest possible value a number in JavaScript can have 1.7976931348623157E+308
MIN_VALUEThe smallest possible value a number in JavaScript can have 5E-324
NaNEqual to a value that is not a number.
NEGATIVE_INFINITYA value that is less than MIN_VALUE.
POSITIVE_INFINITYA value that is greater than MAX_VALUE
prototypeA static property of the Number object. Use the prototype property to assign new properties and methods to the Number object in the current document

ADVERTISEMENTS

MethodDescription
constructor()Returns the function that created this object's instance. By default this is the Number object.
toExponential()Forces a number to display in exponential notation, even if the number is in the range in which JavaScript normally uses standard notation.
toFixed()Formats a number with a specific number of digits to the right of the decimal.
toLocaleString()Returns a string value version of the current number in a format that may vary according to a browser's locale settings.
toPrecision()Defines how many total digits (including digits to the left and right of the decimal) to display of a number.
toString()Returns the string representation of the number's value.
valueOf()Returns the number's value.