Home >Web Front-end >JS Tutorial >Example of using the Number.MIN_VALUE attribute in JavaScript_Basic knowledge

Example of using the Number.MIN_VALUE attribute in JavaScript_Basic knowledge

WBOY
WBOYOriginal
2016-05-16 15:56:441283browse

The Number.MIN_VALUE property belongs to the static Number object. This represents the smallest possible positive constant that JavaScript can work with.

The actual value of this constant is

201564115300827.jpg (97×48)

Grammar

You can access properties using the following syntax:

var val = Number.MIN_VALUE;

Example:

Here is an example showing the use of this attribute.

<html>
<head>
<script type="text/javascript">
<!--
function showValue()
{
  var val = Number.MIN_VALUE;
  alert("Value of Number.MIN_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:

201564115330440.jpg (322×33)

Statement:
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