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
热门推荐
1 如何训练狗狗握手
10 新员工寄语祝福语简短
11 新婚敬酒祝福语大全简短
12 怎么训练狗狗
13 训练狗狗上厕所
14 春蚕老师祝福语简短励志
15 高考好运如愿祝福语简短
16 战哥过年祝福语简短
17 中考感谢朋友祝福语简短
18 长沙旅游祝福语大全简短