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

javascriptInfinity;

Example

Let's determine the result of the following mathematical operation:

javascriptlet res = 1 / 0;
console.log(res);

The code execution result:

javascriptInfinity

Example

Now let's find out the result of division for negative numbers:

javascriptlet res = -1 / 0;
console.log(res);

The code execution result:

javascript-Infinity

See also

  • the true value
    that indicates that the element value is true
  • the false value
    that indicates that the element value is false
  • the null value
    that denotes the absence of an object or element
  • the undefined value
    that denotes that the element value is "undefined"
  • the isFinite function
    that checks a number for finiteness