Skip to content
Related Articles

Related Articles

Improve Article
JavaScript Number NEGATIVE_INFINITY property
  • Last Updated : 31 Jul, 2020

In JavaScript, NEGATIVE_INFINITY is a property of number object which represents negative infinity (-Infinity). It can be explained as a number that is lower than any other number. It is a Read-Only property.

Syntax: NEGATIVE_INFINITY is a static property of the NUMBER object and hence is always used with reference to it

Number.NEGATIVE_INFINITY

Return Value:

-Infinity

Example 1:




<!DOCTYPE html>
<html>
<head>
    <title>Number NEGATIVE_INFINITY property
  </title>
</head>
<body>
    <script type="text/javascript">
        var num=100;
        document.writeln(num.NEGATIVE_INFINITY); 
        document.writeln(Number.NEGATIVE_INFINITY);
    </script>
</body>
</html>

Output:

undefined
-Infinity

Example 2: The following program shows how any number multiplied with negative infinity is negative infinity itself.




<!DOCTYPE html>
<html>
<head>
    <title>Number NEGATIVE_INFINITY property
   </title>
</head>
<body>
    <script type="text/javascript">
        var num=100*Number.NEGATIVE_INFINITY;
        document.write(num);
    </script>
</body>
</html>

Output:

-Infinity



My Personal Notes arrow_drop_up
Recommended Articles
Page :