Infinity
is a number value and a property of the window
global object.
typeof Infinity // number
Syntax
window.Infinity
When Infinity Happened?
Infinity
– When the number more than JavaScript highest number value 1.797693134862315E+308.
-Infinity
– When the number less than JavaScript lowest number value 1.79769313482316E+308.
Positive Infinity and Negative Infinity
Infinity
is represents positive infinity and -Infinity
is represents negative infinity.
Infinity == Infinity // true
Infinity === Infinity // true
Infinity == -Infinity // false
Infinity === -Infinity // false
Browser Support
Browser | Chrome | Edge | Mozilla | Safari | Opera |
Infinity | Yes | Yes | Yes | Yes | Yes |