JavaScript中的一些数学函数 Math.floor(); //向下取整 Math.round(); //取整(四舍五入) Math.random(); //生成[0,1)区间内的随机数 生成[min,max)区间内的随机数 Math.floor(Math.random() * (max - min))