Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

JavaScript MAX_VALUE Property

JavaScript MAX_VALUE Property

Number Object Reference JavaScript Number object

Example

Return the maximum number in JavaScript:

Number.MAX_VALUE;

Return value:

1.7976931348623157e+308

Try it »

Since MAX_VALUE is a property of the Number object, it can be called using Number.MAX_VALUE.

Using a self-created x Number object (x.MAX_VALUE) will not be able to retrieve it.


Definition and Usage

The MAX_VALUE property is the largest number representable in JavaScript.

Its approximate value is 1.7976931348623157 x 10^308.

**Note:** Numbers greater than MAX_VALUE represent infinity.


Use Number.MAX_VALUE

MAX_VALUE is a static property of the JavaScript Number object and can only be called via Number.MAX_VALUE.

Using a custom Number x (x.MAX_VALUE) will not be able to retrieve the MAX_VALUE property:

Example

var x = 100;

x.MAX_VALUE;

The output result of x:

undefined

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All mainstream browsers support the MAX_VALUE property.


Syntax

Number.MAX_VALUE

Technical Details

Return Value: Maximum value, 1.7976931348623157e+308
JavaScript version: 1.1

Number Object Reference JavaScript Number object