Math的属性PI PI属性代表圆周率
Math.abs(x) 返回绝对值
Math.ceil(x) 向上取整
Math.floor(x) 向下取整
Math.max(x) 返回指定值里面的最大最值
Math.min(x,y) 返回指定函数里面最小值
Math.pow(x,y) 返回x的 y 次幂的值

Math.random() 返回介于0 ~ 1之间的一个随机数,包含0不包含1。
Math.round(x) 四舍五入
获取指定范围的随机整数
function randomInt(min,max){
return Math.floor(Math.random()*(max-min+1)+min);
}
网友评论