JavaScript POSITIVE_INFINITYProperty

Number 对象参考手册JavaScript Number Object

Example

Return positive infinity:

Number.POSITIVE_INFINITY;

Output result:

Infinity

Try it yourself »

Definition and Usage

The POSITIVE_INFINITY property value represents positive infinity.

The POSITIVE_INFINITY property represents a value greater than Number.MAX_VALUE.


Using Number.POSITIVE_INFINITY

POSITIVE_INFINITY is a static property of the JavaScript Number object.

The calling syntax is: Number.POSITIVE_INFINITY.

Using a custom Number object x to access this property (x.POSITIVE_INFINITY) will return undefined:

Example

var x = 100;
x.NEGATIVE_INFINITY;

x output result:

undefined

Try it yourself »


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the POSITIVE_INFINITY property.


Syntax

Number.POSITIVE_INFINITY;

Technical Details

Return value: The numeric value: Infinity
JavaScript version: 1.1


More Examples

Example

Create a positive infinity:

var n=(Number.MAX_VALUE)*2;

nOutput result:

Infinity

Try it yourself »


Number 对象参考手册JavaScript Number Object

Other Extensions