Latest web development tutorials

JavaScript POSITIVE_INFINITY property

Number Object Reference JavaScript Number Object

Examples

Return to positive infinity:

Number.POSITIVE_INFINITY;

Output:

Infinity

try it"

Definition and Usage

POSITIVE_INFINITY attribute value represents positive infinity.

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


Use Number.POSITIVE_INFINITY

POSITIVE_INFINITY is a static method JavaScript Number object.

Call the method as: Number.POSITIVE_INFINITY.

Using a custom object x Number to call the property (x.POSITIVE_INFINITY) returns undefined:

Examples

var x = 100;
x.NEGATIVE_INFINITY;

x output:

undefined

try it"


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support POSITIVE_INFINITY property.


grammar

Number.POSITIVE_INFINITY;

technical details

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


More examples

Examples

Create a positive infinity:

var n=(Number.MAX_VALUE)*2;

n output:

Infinity

try it"


Number Object Reference JavaScript Number Object