数字MAX_VALUE属性 (Number MAX_VALUE Property)
MAX_VALUE Property is a Number property in JavaScript and it is used to get the maximum value of a number that is possible in JavaScript.
MAX_VALUE属性是JavaScript中的Number属性,用于获取JavaScript中可能的数字最大值。
Syntax:
句法:
Number.MAX_VALUE;
Note: MAX_VALUE property is called with the "Number", we cannot use this property with a variable. If we use MAX_VALUE with a variable – it returns "undefined".
注意: MAX_VALUE属性用“ Number”调用,我们不能将此属性与变量一起使用。 如果我们将MAX_VALUE与变量一起使用–它返回“ undefined” 。
Examples:
例子:
Input:
Number.MAX_VALUE
Output:
1.7976931348623157e+308
Code:
码:
<html>
<head>
<title>JavaScipt Example</title>
</head>
<body>
<script>
document.write("Max. Value: " + Number.MAX_VALUE + "<br>");
//testing with variable
var num = 123;
document.write("num.MAX_VALUE: " + num.MAX_VALUE + "<br>");
</script>
</body>
</html>
Output
输出量
Max. Value: 1.7976931348623157e+308
num.MAX_VALUE: undefined
翻译自: https://www.includehelp.com/code-snippets/number-MAX_VALUE-property-with-example-in-javascript.aspx