Home >Web Front-end >JS Tutorial >How to use the Number.MAX_VALUE attribute in JavaScript_Basic knowledge
The Number.MAX_VALUE property belongs to the static Number object. This represents the largest possible positive constant that JavaScript can work with.
This constant has an actual value of
Grammar
The value can be accessed using the following syntax:
var val = Number.MAX_VALUE;
Example:
Here is an example of the use of attributes.
<html> <head> <script type="text/javascript"> <!-- function showValue() { var val = Number.MAX_VALUE; alert("Value of Number.MAX_VALUE : " + val ); } //--> </script> </head> <body> <p>Click the following to see the result:</p> <form> <input type="button" value="Click Me" onclick="showValue();" /> </form> </body> </html>
This will produce the following results: