JavaScript | Number.MAX_VALUE & Number.MIN_VALUE with Examples
Number.MAX_VALUE and Number.MIN_VALUE are used to represent maximum and minimum numeric value in javascript.
Syntax Number.MAX_VALUE Number.MIN_VALUE
Return Type
Both Number.MAX_VALUE and Number.MIN_VALUE returns a numeric value.
- MAX_VALUE has a value of approximately 1.79E+308. The values which are larger Number.MAX_VALUE are termed as Infinity.
- MIN_VALUE has a value of approximately 5e-324. The values which are smaller than Number.MIN_VALUE are termed as underflow values.
- Both MAX_VALUE and MIN_VALUE are static property of Number. Therefore using x.MAX_VALUE or x.MIN_VALUE will return undefined where x is a Number or Number Object.
<script> // JavaScript Code to illustrate Number.MAX_VALUE // & Number.MIN_VALUE function func() { // MAX_VALUE var a = Number.MAX_VALUE; document.write(a); // New Line document.write("<br>"); // MIN_VALUE a = Number.MIN_VALUE; document.write(a); // New Line document.write("<br>"); a = 1 // Undefined Behaviour document.write(a.MAX_VALUE); } func(); < /script> |
chevron_right
filter_none
Output :
1.7976931348623157e+308
5e-324
undefined
Recommended Posts:
- JavaScript | typedArray.every() with Examples
- JavaScript | typedArray.map() with Examples
- JavaScript | _.reduceRight() with Examples
- JavaScript | weakSet.has() with Examples
- JavaScript | unescape() with examples
- JavaScript | getPrototypeOf() with Examples
- JavaScript | parseInt() with Examples
- JavaScript | uneval() with Examples
- JavaScript | console.log() with Examples
- JavaScript | weakMap.set() with Examples
- JavaScript | typedArray.of() with Examples
- JavaScript | weakMap.has() with Examples
- JavaScript | typedArray.name with Examples
- Javascript | _.reduce() with Examples
- JavaScript | typedArray.from() with Examples
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.



