Infinity

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Die globale Eigenschaft Infinity ist ein numerischer Wert, der die Unendlichkeit darstellt.

Probieren Sie es aus

Wert

Der gleiche Zahlenwert wie Number.POSITIVE_INFINITY.

Eigenschaften von Infinity
Schreibbarnein
Aufzählbarnein
Konfigurierbarnein

Beschreibung

Infinity ist eine Eigenschaft des globalen Objekts. Mit anderen Worten, es ist eine Variable im globalen Gültigkeitsbereich.

Der Wert Infinity (positive Unendlichkeit) ist größer als jede andere Zahl.

Dieser Wert verhält sich etwas anders als die mathematische Unendlichkeit; siehe Number.POSITIVE_INFINITY für Details.

Beispiele

Verwendung von 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 */

Spezifikationen

Specification
ECMAScript® 2025 Language Specification
# sec-value-properties-of-the-global-object-infinity

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
Infinity

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Siehe auch