How To Use Number Object POSITIVE_INFINITY In JavaScript

In this article I am going to explain about Number Object POSITIVE_INFINITY Property In JavaScript.
  • 1847

Use POSITIVE_INFINITY Property in JavaScript

The POSITIVE_INFINITY property returns positive infinity.

This property is represent the largest number of 0 (greater then 0).

All browsers support number object POSITIVE_INFINITY property.

Syntax

Number.POSITIVE_INFINITY;

Example

<!DOCTYPE html>

<html>

<body style ="background-color:Red">

 

<p id="demo">Display positive infinity.</p>

 

<button onclick="myFunction()">Click here</button>

 

<script type="text/javascript">

    function myFunction()

    {

        var x = document.getElementById("demo");

        x.innerHTML = Number.POSITIVE_INFINITY;

    }

</script>

 

</body>

</html>

Output1

op1.jpg

Output2

 op2.jpg

Further Readings

You may also want to read these related articles :here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.