JavaScript Number NEGATIVE_INFINITY property

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:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!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>

chevron_right


Output:



undefined
-Infinity

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

filter_none

edit
close

play_arrow

link
brightness_4
code

<!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>

chevron_right


Output:

-Infinity

full-stack-img




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.