let x = Number.NEGATIVE_INFINITY;
Try it Yourself »
Create a negative infinity:
let n = (-Number.MAX_VALUE) * 2;
Try it Yourself »
Number.NEGATIVE_INFINITY
returns negative infinity.
Number.NEGATIVE_INFINITY
is "a number lower than any other number".
NEGATIVE_INFINITY is a property of the JavaScript Number object.
You can only use it as Number.NEGATIVE_INFINITY.
Using x.NEGATIVE_INFINITY, where x is a variable, will return undefined:
Number.NEGATIVE_INFINITY
Type | Description |
A number | -Infinity |
Number.NEGATIVE_INFINITY
is an ECMAScript1 (ES1) feature.
ES1 (JavaScript 1997) is fully supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!