JavaScript Number.MAX_VALUE Property
Number.MAX_VALUE represents the biggest possible numeric value of a positive number that can be represented in JavaScript. It is the maximum possible positive number representable in JavaScript within float precision.
Syntax:
Number.MAX_VALUE
Return Value: It possesses the value of the biggest positive number which is approximately 1.79E+308, or 1.7976931348623157 * (10^308).
Note: As MAX_VALUE is a static property of the Number class, we should always use it as Number.MAX_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 MAX_VALUE property of the object, it will return undefined.
If we take the negative of Number.MAX_VALUE, it will represent the minimum possible negative number in JavaScript as the value of the negative number will be maximum making it minimum possible negative number.
Example 1:
HTML
< script type = "text/javascript" > let num=100; console.log(num.MAX_VALUE); console.log(Number.MAX_VALUE); </ script > |
Output:
undefined VM646:3 1.7976931348623157e+308
Example 2:
HTML
< script type = "text/javascript" > let num=100; console.log(num.MAX_VALUE); </ script > |
Output:
undefined
Supported Browsers:
- Chrome 1 and above
- Edge 12 and above
- Firefox 1 and above
- Internet Explorer 4 and above
- Opera 3 and above
- Safari 1 and above
Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE
Please Login to comment...