JavaScript中的Math.max()函数
max()Math对象的函数接受多个数字,并返回其中最大的数字。
如果将单个数字传递给此函数,它将返回相同的
而且,如果不传递任何参数,它将返回无穷大。
语法
其语法如下
Math.max(48, 148, 3654);
示例
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var result = Math.max(48, 148, 3654);
document.write("Maximum of the given numbers: "+result);
</script>
</body>
</html>输出结果
Maximum of the given numbers: 3654
热门推荐
10 财运虎年祝福语简短语
11 单亲爸爸春节祝福语简短
12 狗狗上厕所训练
13 植物种植祝福语简短
14 翻译考试祝福语朋友简短
15 个人周年庆简短祝福语
16 狗狗怎么训练
17 分别祝福语简短搞笑英文
18 生日广州男生祝福语简短