Javascript Number.MAX_VALUE

Introduction

The Javascript Number.MAX_VALUE property represents the maximum numeric value in JavaScript.

The MAX_VALUE property has a value of approximately 1.79E+308.

Values larger than MAX_VALUE are represented as Infinity.

The following code multiplies two numeric values.

let num1 = 10000;
let num2 = 10000;
if (num1 * num2 <= Number.MAX_VALUE) {
  console.log("less than or equal to Number.MAX_VALUE");
} else {//from   w  ww  . j  a v a 2  s . co  m
  console.log("larger than Number.MAX_VALUE");
}



PreviousNext

Related