Search This Blog

Monday, 1 August 2016

How to display positive infinity in javascript?

Html page:

<button onclick="myFunction()">Try it</button>
<p id="P3"></p>

Javascript page:

<script>
    function myFunction() {
        document.getElementById("demo").innerHTML = Number.POSITIVE_INFINITY;
    }
</script>

Output:
Infinity


No comments:

Post a Comment