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

Infinity - JavaScript | MDN

Esta pgina ha sido traducida del ingls por la comunidad. Aprende ms y nete a la comunidad de 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 julio de 2015.

La propiedad global Infinity es un valor numrico que representa el infinito.

In this article

Prubalo

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

Valor

El mismo valor numrico que Number.POSITIVE_INFINITY.

Atributos de la propiedad Infinity
SobrescribirNo
NumerableNo
ConfigurableNo

Descripcin

Infinity es una propiedad del objeto global. En otras palabras, es una variable de alcance global.

El valor Infinity (infinito positivo) es mayor que cualquier otro nmero.

Este valor se comporta de forma ligeramente diferente al infinito matemtico; consulte Number.POSITIVE_INFINITY para obtener ms informacin.

Ejemplos

Utilizando 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 */

Especificaciones

Specification
ECMAScript 2027 LanguageSpecification
# sec-value-properties-of-the-global-object-infinity

Compatibilidad con navegadores

Vase tambin


Web Proxy Viewer  |  New URL  |  Original Page