JavaScript Number.MIN_VALUE Property
Number.MIN_VALUE is the smallest possible positive number representable in JavaScript within float precision. It does not represent the most negative number, instead of that, it possesses the value of the smallest positive number which is closest to 0.
Syntax:
Number.MIN_VALUE
Return Value: It has approximately a value of 5E-324(>0). But in practice, the more precise value of Number.MIN_VALUE in Node.js and browsers is 2^-1074.
Note: As MIN_VALUE is a static property of the Number class, we should always use it as Number.MIN_VALUE instead of using as a property of the object created from the Number class ( static properties always belong to the class, not to the objects). So, we create a Number object and try to access the MIN_VALUE property of the object, it will return undefined.
Let us look at some examples to see how to use this property:
Example 1:
Javascript
<script type= "text/javascript" > let num=100; console.log(Number.MIN_VALUE); console.log( "Check if it is greater than zero :" , Number.MIN_VALUE>0); </script> |
Output:
5e-324 Check if it is greater than zero : true
Example 2:
Javascript
<script type= "text/javascript" > let num=100; console.log(num.MIN_VALUE); </script> |
Output:
undefined
Supported Browsers:
- Chrome 1 and above
- Edge 12 and above
- Firefox 1 and above
- Opera 3 and above
- Safari 1 and above
Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE
Please Login to comment...