js学习

​ Math.round();向上四舍五入。

  Math.ceil();向上取整,有小数就整数部分加1

  Math.floor() ;向下取整

  Math.abs();返回绝对值;

  Math.max();返回两个以上参数的最大值;

  Math.min();返回两个以上参数的最小值;

​ Math.random() // [ 0 , 1 )

​ Math.random()*50 //[ 0 , 50 )

​ Math.floor( Math.random()*51 ) //[0,50]

​ Math.floor( Math.random()*11 + 41 ) //[41,52]

​ Math.sin( Math.PI/6 ) //0.5