Javascript Number.POSITIVE_INFINITY

Introduction

The Javascript Number.POSITIVE_INFINITY property stores the positive Infinity value.

In the following example, the variable bigNumber is assigned a value that is larger than the maximum value.

var bigNumber = Number.MAX_VALUE * 2;

if (bigNumber == Number.POSITIVE_INFINITY) {
  console.log("is "+ Number.POSITIVE_INFINITY);
}else{
  console.log("is not "+ Number.POSITIVE_INFINITY);
}



PreviousNext

Related