[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Infinity [Back]  [Original]

Infinity - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

Infinity

Baseline Widely available

This feature is well established and works across many devices and browser versions. Its been available across browsers since 20157.

Infinity

In this article

const maxNumber = 10 ** 1000; // 

if (maxNumber === Infinity) {
  console.log("");
  // 
}

console.log(1 / maxNumber);
// 0

Number.POSITIVE_INFINITY

Infinity

Infinity

Infinity

Number.POSITIVE_INFINITY

Infinity

js
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


Web Proxy Viewer  |  New URL  |  Original Page