Some definitions from W3Schools:
Infinity: A numeric value that represents positive/negative infinity
The POSITIVE_INFINITY property represents infinity, returned on overflow.
NEGATIVE_INFINITY, represents negative infinity (returned on overflow).
The NaN property represents "Not-a-Number" value. This property indicates that a value is not a legal number.
The isFinite() function determines whether a number is a finite, legal number.
This function returns false if the value is +infinity, -infinity, or NaN.
Some tests:
var n1 = 1/0;
var n2 = 0/0;
var n3 = (Number.MAX_VALUE)*2; //overflow
var b1 = Number.POSITIVE_INFINITY == n1;
var b2 = Number.POSITIVE_INFINITY == n2;
var b2n = Number.NEGATIVE_INFINITY == n2;
var b3 = Number.POSITIVE_INFINITY == n3;
var msg = "n1=" + n1 + ", n2=" + n2 + ", n3=" + n3;
msg += "<br/> n1 Is POSITIVE_INFINITY=" + b1;
msg += "<br/> n2 Is POSITIVE_INFINITY=" + b2;
msg += "<br/> n2 Is POSITIVE_INFINITY=" + b2n;
msg += "<br/> n3 Is POSITIVE_INFINITY=" + b3;
msg += "<br/> n1 IsFinite=" + isFinite(n1);
msg += "<br/> n2 IsFinite=" + isFinite(n2);
msg += "<br/> n3 IsFinite=" + isFinite(n3);
msg += "<br/> n1 + n1 =" + (n1 + n1) ;
msg += "<br/> n1 - n1 =" + (n1 - n1) ;
msg += "<br/> n2 + n1 =" + (n2 + n1) ;
document.write(msg);
Shows
n1=Infinity, n2=NaN, n3=Infinity
n1 Is POSITIVE_INFINITY=true
n2 Is POSITIVE_INFINITY=false
n2 Is POSITIVE_INFINITY=false
n3 Is POSITIVE_INFINITY=true
n1 IsFinite=false
n2 IsFinite=false
n3 IsFinite=false
n1 + n1 =Infinity
n1 - n1 =NaN
n1 - n1 =NaN