round() : 表示四舍五入,算法为Math.floor(x+0.5), 即将原来的数字加上0.5后再向下取整,所以,Math.round(11.5)的结果为12,Math.round(-1.4)的结果为-1。
random() :方法用于返回一个随机数,随机数范围为 0.0 =< Math.random < 1.0。
round() : 表示四舍五入,算法为Math.floor(x+0.5), 即将原来的数字加上0.5后再向下取整,所以,Math.round(11.5)的结果为12,Math.round(-1.4)的结果为-1。
random() :方法用于返回一个随机数,随机数范围为 0.0 =< Math.random < 1.0。