JavaScript Number NEGATIVE_INFINITY property

Definition and usage

Number.NEGATIVE_INFINITY Returns negative infinity.

Number.NEGATIVE_INFINITY It is 'a number that is lower than any other number'.

NEGATIVE_INFINITY The property represents a number smaller than Number.MIN_VALUE Value.

This value represents negative infinity.

Example

Example 1

let x = Number.NEGATIVE_INFINITY;

Try it yourself

Example 2

Create negative infinity:

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

Try it yourself

Number.NEGATIVE_INFINITY

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

Syntax

Number.NEGATIVE_INFINITY

Return value

Type Description
Value -Infinity

Description

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

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 代替 Number.NEGATIVE_INFINITY.

Browser support

Number.NEGATIVE_INFINITY Es ist eine ECMAScript1 (ES1)-Eigenschaft.

Alle Browser unterstützen ES1 (JavaScript 1997) vollständig:

Chrome IE Edge Firefox Safari Opera
Chrome IE Edge Firefox Safari Opera
Unterstützung Unterstützung Unterstützung Unterstützung Unterstützung Unterstützung