JavaScript常用方法

108 阅读1分钟

Math.max(...Numbars)

取得参数中的最大值

Math.min(...Numbars)

取得参数中的最小值

Math.max.apply()

取得数组中的最大值

Math.min.apply()

取得数组中的最小值

Math.ceil()

天花板函数,向上取整

Math.floor()

地板函数,向下取整

Math.round()

标准四舍五入

Math.random()

返回介于0和1之间的伪随机数。