Javascript - Number POSITIVE_INFINITY Property

The POSITIVE_INFINITY property represents positive infinity.

Description

The POSITIVE_INFINITY property represents positive infinity.

POSITIVE_INFINITY a static property of the Number object.

You can only use it as Number.POSITIVE_INFINITY.

Using x.POSITIVE_INFINITY, where x is a number or a Number object, will return undefined:

Syntax

Number.POSITIVE_INFINITY;

Return

The numeric value: Infinity

Example

The value of x will be:

Demo

//display positive infinity.
var x = 100;// w  ww. ja  v  a  2s .  c om
console.log(x.POSITIVE_INFINITY);

//Return positive infinity:

console.log(Number.POSITIVE_INFINITY);

//Create a positive infinity:

//create a positive infinity.
var n = (Number.MAX_VALUE) * 2;
console.log(n);

Result