JS: Infinity

By Xah Lee. Date: .

Infinity is a builtin value.

Infinity is typically returned when divide by zero.

console.log ( 1/0 === Infinity ); // true

Type of Infinity is "number".

[see JS: Value Types]

console.log ( typeof Infinity === "number" ); // true

Infinity === Infinity return true.

console.log ( Infinity === Infinity ); // true

Test Infinity

To test if a value is finite, use Number.isFinite.

[see JS: Number.isFinite]

JS Number

  1. Format Number
  2. String to Number
  3. Number Object
  4. Number.prototype
Like it? Help me by telling your friends. Or, Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS in Depth
  4. JS Object Ref
  5. DOM Scripting
  6. SVG
  7. Blog