Infinity value
The Infinity value denotes
infinity, with Infinity being
positive infinity (equal to 1/0)
and -Infinity being negative
infinity (equal to -1/0).
Syntax
Infinity;
Example
Let's determine the result of the following mathematical operation:
let res = 1 / 0;
console.log(res);
The code execution result:
Infinity
Example
Now let's find out the result of division for negative numbers:
let res = -1 / 0;
console.log(res);
The code execution result:
-Infinity
See also
-
the
truevalue
that indicates that the element value is true -
the
falsevalue
that indicates that the element value is false -
the
nullvalue
that denotes the absence of an object or element -
the
undefinedvalue
that denotes that the element value is "undefined" -
the
isFinitefunction
that checks a number for finiteness