Course recommendation:

JavaScript Number NEGATIVE_INFINITY property

Number.NEGATIVE_INFINITY Definition and usage

Number.NEGATIVE_INFINITY Returns negative infinity.

NEGATIVE_INFINITY It is 'a number lower than any other number'. The property represents less than Number.MIN_VALUE

The value.

Using x.NEGATIVE_INFINITY, where x is a variable, will return undefined:

This value represents negative infinity.

Example 1

x.NEGATIVE_INFINITY;

let x = Number.NEGATIVE_INFINITY;

Example 2

Create negative infinity:

x.NEGATIVE_INFINITY;

Number.NEGATIVE_INFINITY

let n = (-Number.MAX_VALUE) * 2;

NEGATIVE_INFINITY is a property of the JavaScript Number object.

You can only use it as Number.NEGATIVE_INFINITY.

Using x.NEGATIVE_INFINITY, where x is a variable, will return undefined:

Example
let x = 100;

x.NEGATIVE_INFINITY;

Try it yourself

Number.NEGATIVE_INFINITY

Syntax

Return value Type
Value -Infinity

Description

Number.NEGATIVE_INFINITY as a special value that returns when an arithmetic operation or function generates a number smaller than the smallest negative number that JavaScript can represent (that is, smaller than -Number.MAX_VALUE).

JavaScript displays NEGATIVE_INFINITY when using -Infinity. This value's arithmetic behavior is 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 Instead of Number.NEGATIVE_INFINITY.

Browser support

Number.NEGATIVE_INFINITY It is an ECMAScript1 (ES1) feature.

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