This JavaScript tutorial explains how to use the Number property known as POSITIVE_INFINITY with syntax and examples.
Description
In JavaScript, POSITIVE_INFINITY is a static property of the Number object that is used to return the fee that represents high quality infinity (ie: Infinity). Because POSITIVE_INFINITY is a property of the Number object, it should be invoked through the object referred to as Number.
Syntax
In JavaScript, the syntax for the POSITIVE_INFINITY property is:
Number.POSITIVE_INFINITY;
Parameters or Arguments
There are no parameters or arguments for the POSITIVE_INFINITY property.
Returns
The POSITIVE_INFINITY property returns the fee that represents fantastic infinity which is Infinity.
Note
The POSITIVE_INFINITY property is a property of the Number object and no longer a number function. However, we have blanketed the POSITIVE_INFINITY property inside our JS Number Methods part because you will most in all likelihood use this property in conjunction with the Number strategies discovered in this section.
Example
Let’s take a appear at an example of how to use the POSITIVE_INFINITY property in JavaScript.
For example:
console.log(Number.POSITIVE_INFINITY);
In this example, we have invoked the POSITIVE_INFINITY property the use of the Number class.
We have written the output of the POSITIVE_INFINITY property to the internet browser console log, for demonstration purposes, to exhibit what the POSITIVE_INFINITY property returns.
The following will be output to the net browser console log:
Infinity
In this example, the POSITIVE_INFINITY property returned a cost of Infinity which represents high quality infinity in JavaScript.
Leave a Review