目录

Math.min(x1, x2,...)

此方法返回零或更多数字中的最小值。 如果没有给出参数,则结果为+ Infinity。

语法 (Syntax)

Math.min( x1,x2,… ) ;       

参数 (Parameter)

  • X1,x2,x3 .. - 代表一系列数字

例子 (Example)

console.log("---Math.min()---") 
console.log("Math.min(1, 2) : "+Math.min(1, 2)) 
console.log("Math.min(3, 0.5, 0.66) : "+Math.min(3, 0.5, 0.66)) 
console.log("Math.min(3, 0.5, -0.66) : "+Math.min(3, 0.5, -0.66))          

输出 (Output)

---Math.min()--- 
Math.min(1, 2) : 1 
Math.min(3, 0.5, 0.66) : 0.5 
Math.min(3, 0.5, -0.66) : -0.66        
↑回到顶部↑
WIKI教程 @2018