JavaScript Number NEGATIVE_INFINITY property
- Forrige side NaN
- Næste side POSITIVE_INFINITY
- Gå tilbage til niveauet over JavaScript Number Reference Håndbog
Definition and usage
Number.NEGATIVE_INFINITY
Returns negative infinity.
Number.NEGATIVE_INFINITY
is 'a number lower than any other number'.
NEGATIVE_INFINITY
The property represents less than Number.MIN_VALUE
Value.
This value represents negative infinity.
Example
Example 1
let x = Number.NEGATIVE_INFINITY;
Example 2
Create negative infinity:
let n = (-Number.MAX_VALUE) * 2;
Number.NEGATIVE_INFINITY
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:
Example
let x = 100; x.NEGATIVE_INFINITY;
Syntax
Number.NEGATIVE_INFINITY
Return value
Type | Description |
---|---|
Value | -Infinity |
Description
Number.NEGATIVE_INFINITY
is a special value that returns when an arithmetic operation or function generates a number smaller than the smallest negative number that JavaScript can represent (that is, smaller than -Number.MAX_VALUE).
JavaScript displays NEGATIVE_INFINITY
when using -Infinity
This value has an arithmetic behavior very similar to infinity. For example, any number multiplied by infinity results in infinity, and any number divided by infinity results in 0.
In ECMAScript v1 and subsequent versions, it can also be used -Infinity
instead of Number.NEGATIVE_INFINITY
。
browser support
Number.NEGATIVE_INFINITY
Er en ECMAScript1 (ES1) egenskab.
Alle browsere understøtter fuldt ES1 (JavaScript 1997):
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Forrige side NaN
- Næste side POSITIVE_INFINITY
- Gå tilbage til niveauet over JavaScript Number Reference Håndbog