- 0133技术站
- 联系QQ:18840023
- QQ交流群
- 微信公众号
Math.max()方法返回零或多个数字中的最大值。 如果没有给出参数,则结果为-Infinity。
语法:
Math.max(x1,x2,x3..)
参数:
● x1,x2,x3 .. - 表示一系列数字
例:
console.log("---Math.max()---") console.log("Math.max(3, 0.5, 0.66) : "+Math.max(3, 0.5, 0.66)) console.log("Math.max(-3, 0.5, -0.66) : "+Math.max(-3, 0.5, -0.66))
输出:
---Math.max()--- Math.max(3, 0.5, 0.66) : 3 Math.max(-3, 0.5, -0.66) : 0.5
推荐手册