Infinity
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2015ë 7ì.
Infinity ì ì ìì±ì 무íë를 ëíë´ë ì«ì ê°ì
ëë¤.
ìëí´ ë³´ê¸°
const maxNumber = Math.pow(10, 1000); // Max positive number
if (maxNumber === Infinity) {
console.log("Let's call it Infinity!");
// Expected output: "Let's call it Infinity!"
}
console.log(1 / maxNumber);
// Expected output: 0
ê°
Number.POSITIVE_INFINITYì ëì¼í ì«ì ê°ì
ëë¤.
Property attributes of Infinity | |
|---|---|
| ì°ê¸° ê°ë¥ | ë¶ê°ë¥ |
| ì´ê±° ê°ë¥ | ë¶ê°ë¥ |
| ì¤ì ê°ë¥ | ë¶ê°ë¥ |
ì¤ëª
Infinityë ì ì ê°ì²´ì ìì±ì
ëë¤. ì¦, ì ì ë²ìì ë³ìì
ëë¤.
Infinity(ìì 무íë)ë ë¤ë¥¸ ì´ë¤ ìë³´ë¤ ë í½ëë¤. ìíì ì¸ ë¬´íëìë ì¼ë¶ ì°¨ì´ì ì´ ììµëë¤. Number.POSITIVE_INFINITY 문ììì ë ììë³´ì¸ì.
ìì
>Infinity ì¬ì©í기
js
console.log(Infinity); /* Infinity */
console.log(Infinity + 1); /* Infinity */
console.log(Math.pow(10, 1000)); /* Infinity */
console.log(Math.log(0)); /* -Infinity */
console.log(1 / Infinity); /* 0 */
console.log(1 / 0); /* Infinity */
ëª ì¸
| Specification |
|---|
| ECMAScript® 2027 Language Specification> # sec-value-properties-of-the-global-object-infinity> |