MAX_VALUE  Number  class property JS Home  <<  JS Reference  <<  Number  <<  MAX_VALUE

Description

The maximum positive number value that can be represented in JavaScript.

  • Like all class properties MAX_VALUE should be used on the class rather than an instance of the class.

Syntax

Signature Description
Number.MAX_VALUEThe maximum positive number value that can be represented in JavaScript.

Parameters

None.

Examples

The code below displays some MAX_VALUE usages.



var maxValue = new Array(4);

  maxValue[0] = Number.MAX_VALUE;
maxValue[1] = Number.MAX_VALUE * -1;

if (Number.MAX_VALUE >= Infinity) {
  maxValue[2] = 'Number.MAX_VALUE >= Infinity';
} else {
  maxValue[2] = 'Number.MAX_VALUE < Infinity';
}

if ((Number.MAX_VALUE * -1) <= -Infinity) {
  maxValue[3] = '(Number.MAX_VALUE  * -1) <= -Infinity';
} else {
  maxValue[3] = '(Number.MAX_VALUE  * -1) > -Infinity';
}

alert(maxValue);

  

Press the button below to action the above code:

Related Tutorials

JavaScript Advanced Tutorials - Lesson 3 - Number

JavaScript Basics

JavaScript Basics

JavaScript Intermediate

JavaScript Intermediate

JavaScript Advanced

JavaScript Advanced

JavaScript Reference

JavaScript Entities

Globals

Number

Class Properties
MAX_VALUE
MIN_VALUE
NaN
NEGATIVE_INFINITY
POSITIVE_INFINITY
prototype
Instance Properties
constructor
Class Methods
None.
Instance Methods Getters
toExponential()
toFixed()
toLocaleString()
toPrecision()
toString()
valueOf()
Instance Methods Setters
None.

Statements

Operators