JavaScript Number NEGATIVE_INFINITY property
- Halaman Sebelumnya NaN
- Halaman Berikutnya POSITIVE_INFINITY
- Kembali ke Tindakan Atas Panduan Rujukan Number JavaScript
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 a number smaller than the smallest negative number that JavaScript can represent (that is, smaller than -Number.MAX_VALUE) when an arithmetic operation or function generates a number.
JavaScript displays NEGATIVE_INFINITY
when using -Infinity
This value's arithmetic behavior is very similar to infinity. For example, any number multiplied by infinity still results in infinity, and any number divided by infinity results in 0.
In ECMAScript v1 and later versions, it can also be used -Infinity
replace Number.NEGATIVE_INFINITY
。
browser support
Number.NEGATIVE_INFINITY
是 ECMAScript1 (ES1) 特性。
Adalah ciri ECMAScript1 (ES1).
Semua pelayar mendukung ES1 (JavaScript 1997): | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Semua pelayar mendukung ES1 (JavaScript 1997): | IE | Edge | Firefox | Safari | Opera |
Dukungan | Dukungan | Dukungan | Dukungan | Dukungan | Dukungan |
- Halaman Sebelumnya NaN
- Halaman Berikutnya POSITIVE_INFINITY
- Kembali ke Tindakan Atas Panduan Rujukan Number JavaScript