JavaScript Number POSITIVE_INFINITY property
- Previous Page NEGATIVE_INFINITY
- Next Page parseFloat()
- Go Back to the Previous Level JavaScript Number Reference Manual
Definition and usage
POSITIVE_INFINITY
Returns positive infinity.
POSITIVE_INFINITY
‘greater than any other number’.
POSITIVE_INFINITY
The property represents numbers greater than Number.MAX_VALUE
value.
This value represents positive infinity.
Example
Example 1
let x = Number.POSITIVE_INFINITY;
Example 2
Create positive infinity:
let n = (Number.MAX_VALUE) * 2;
Number.POSITIVE_INFINITY
POSITIVE_INFINITY is a property of the JavaScript Number object.
You can only use it as Number.POSITIVE_INFINITY.
If you use x.POSITIVE_INFINITY, where x is a variable, it will return undefined:
Example
let x = 100; x.POSITIVE_INFINITY;
Syntax
Number.POSITIVE_INFINITY
Return value
Type | Description |
---|---|
Number | Infinity |
Description
Number.POSITIVE_INFINITY
is a special value that is returned in arithmetic operations or function generation when a number larger than the largest number that JavaScript can represent (that is, larger than Number.MAX_VALUE
when it returns a number that is larger than
JavaScript displays POSITIVE_INFINITY
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
Replaced by Number.POSITIVE_INFINITY
.
Browser support
Number.POSITIVE_INFINITY
It is a feature of ECMAScript1 (ES1).
All Browsers Fully Support ES1 (JavaScript 1997):
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous Page NEGATIVE_INFINITY
- Next Page parseFloat()
- Go Back to the Previous Level JavaScript Number Reference Manual