Search This Blog

Monday, 1 August 2016

How to number to display negative infinity using javascript?

Html page:

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

Javascript page:

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

Output:

-Infinity

No comments:

Post a Comment