Javascript Number.NEGATIVE_INFINITY

Introduction

The Javascript Number.NEGATIVE_INFINITY property stores the negative Infinity value.

In the following example, the variable smallNumber is assigned a value that is smaller than the minimum value.

var smallNumber = (-Number.MAX_VALUE) * 2;

if (smallNumber === Number.NEGATIVE_INFINITY) {
  console.log(Number.NEGATIVE_INFINITY);
}else{
  console.log("not "+Number.NEGATIVE_INFINITY);
}



PreviousNext

Related