Home > Web Front-end > JS Tutorial > How to use the Number.MAX_VALUE attribute in JavaScript_Basic knowledge

How to use the Number.MAX_VALUE attribute in JavaScript_Basic knowledge

WBOY
Release: 2016-05-16 15:56:45
Original
2005 people have browsed it

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

201564114603685.jpg (249×35)

Grammar

The value can be accessed using the following syntax:

var val = Number.MAX_VALUE;

Copy after login

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>

Copy after login

This will produce the following results:

201564114042327.jpg (473×35)

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template