This JavaScript tutorial explains how to use the Number property called NEGATIVE_INFINITY with syntax and examples.
Description
In JavaScript, NEGATIVE_INFINITY is a static property of the Number object that is used to return the fee that represents bad infinity (ie: -Infinity). Because NEGATIVE_INFINITY is a property of the Number object, it must be invoked via the object referred to as Number.
Syntax
In JavaScript, the syntax for the NEGATIVE_INFINITY property is:
Number.NEGATIVE_INFINITY;
Parameters or Arguments
There are no parameters or arguments for the NEGATIVE_INFINITY property.
Returns
The NEGATIVE_INFINITY property returns the value that represents terrible infinity which is -Infinity.
Note
The NEGATIVE_INFINITY property is a property of the Number object and now not a range function. However, we have protected the NEGATIVE_INFINITY property inside our JS Number Methods area because you will most likely use this property in conjunction with the Number techniques observed in this section.
Example
Let’s take a seem to be at an example of how to use the NEGATIVE_INFINITY property in JavaScript.
For example:
console.log(Number.NEGATIVE_INFINITY);
In this example, we have invoked the NEGATIVE_INFINITY property using the Number class.
We have written the output of the NEGATIVE_INFINITY property to the net browser console log, for demonstration purposes, to exhibit what the NEGATIVE_INFINITY property returns.
The following will be output to the web browser console log:
-Infinity
In this example, the NEGATIVE_INFINITY property lower back a fee of -Infinity which represents poor infinity in JavaScript.
Leave a Review