| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Global_Objects/Infinity | [Back] [Original] |
Get to know MDN better
Esta pgina ha sido traducida del ingls por la comunidad. Aprende ms y nete a la comunidad de MDN Web Docs.
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.
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
El mismo valor numrico que Number.POSITIVE_INFINITY.
Atributos de la propiedad Infinity | |
|---|---|
| Sobrescribir | No |
| Numerable | No |
| Configurable | No |
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.
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 LanguageSpecification # sec-value-properties-of-the-global-object-infinity |
This page was last modified on 11 feb 2025 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 |