Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

JavaScript Number.MIN_SAFE_INTEGER Constant

  • Last Updated : 24 Dec, 2021

Below is the example of the Number.MIN_SAFE_INTEGER Constant.

  • Example:




    <script type="text/javascript">
        document.write(Number.MIN_SAFE_INTEGER); 
    </script
  • Output:

    -9007199254740991

The JavaScript Number.MIN_SAFE_INTEGER is a constant number which represents the minimum safe integer. This constant has a value of (-(253 – 1)).

Use Number.MIN_SAFE_INTEGER, as a property of a number object because it is a static property of number.

Syntax:

Number.MIN_SAFE_INTEGER

Return Value: Constant number.

Example 1: Below example illustrates the use of simple Number.MIN_SAFE_INTEGER constant.




<!DOCTYPE html>
  
<html lang="en">
  
<body>
    <h1 style="color: green;">GeeksforGeeks</h1>
    <script type="text/javascript">
        const a = Number.MIN_SAFE_INTEGER - 1;
        const b = Number.MIN_SAFE_INTEGER - 2;
  
        console.log(Number.MIN_SAFE_INTEGER);
        console.log(a);
        console.log(a === b);
    </script>
</body>
  
</html>

Output:

Example 2: Below example illustrates the usage of Number.MIN_SAFE_INTEGER constant using Math.pow() function.




<!DOCTYPE html>
  
<html lang="en">
  
<body>
    <h1 style="color: green;">GeeksforGeeks</h1>
    <script type="text/javascript">
        const c = Number.MIN_SAFE_INTEGER;
        const d = -(Math.pow(2, 53) - 1);
  
        console.log(c);
        console.log(d);
        console.log(c === d);
    </script>
</body>
  
</html>

Output:

Note: Internet explorer is not supported.

Supported Browsers:

  1. Chrome 34 and above
  2. Edge 12 and above
  3. Firefox 31 and above
  4. Opera 21 and above
  5. Safari 9 and above

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!