Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

JavaScript Infinity Property

JavaScript Infinity Property

Function Reference JavaScript Global Functions


Definition and Usage

The Infinity property stores the numeric value representing positive infinity.

Negative infinity is a numeric value representing negative infinity.

In JavaScript, values greater than 1.797693134862315E+308 are Infinity, and values less than -1.797693134862316E+308 are infinitesimal.


Browser support

Chrome IE Edge Firefox Safari Opera
Yes Yes Yes Yes Yes Yes

Example

Example

Output a number exceeding positive infinity:

let

x

=

1.797693134862315

E

308

;

let

y

=

x

1.001

;

The output of the above example is:

Infinity

Try it »

Example

Output a number exceeding negative infinity:

let

x

= -

1.797693134862316

E

308

;

let

y

=

x

1.001

;

The output of the above example is:

-Infinity

Try it »


Function Reference JavaScript Global Functions