ES6 Math.max(x1,x2,x3..)

此方法返回零个或多个数字中的最大值。如果没有给出参数,则结果为-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

此函数返回x弧度的正弦值。语法Math.sin(x)参数X1 - 代表一个数字例console.log("---Math.sin()---")console.log("Math.sin(Math.PI/2): ...