| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Infinity | [Back] [Original] |
Get to know MDN better
This feature is well established and works across many devices and browser versions. Its been available across browsers since 20157.
Infinity
const maxNumber = 10 ** 1000; //
if (maxNumber === Infinity) {
console.log("");
//
}
console.log(1 / maxNumber);
// 0
Infinity | |
|---|---|
Infinity
Infinity
console.log(Infinity); /* Infinity */
console.log(Infinity + 1); /* Infinity */
console.log(10 ** 1000); /* Infinity */
console.log(Math.log(0)); /* -Infinity */
console.log(1 / Infinity); /* 0 */
console.log(1 / 0); /* Infinity */
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-value-properties-of-the-global-object-infinity |
This page was last modified on 202584 by MDN contributors.
Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |