Sep 13, 2018

Not a real number values of JavaScript

// There are three special not-a-real-number values:
Infinity; // result of e.g. 1/0
-Infinity; // result of e.g. -1/0
NaN; // result of e.g. 0/0, stands for 'Not a Number'

typeof Infinity;        // returns "number"

var myNumber = 88;
while (myNumber != Infinity) {          // Execute until Infinity
    myNumber = myNumber * myNumber;
}