【简单的JS知识点,复习用】
Math:JS内置对象
//Math
Math.random()//获取0-1的随机数
console.log(Math.random() * 10);//获取1-10的随机数乘十
Math.abs()//求绝对值
console.log(Math.abs(-8));// 8
Math.ceil()//向上取整
console.log(Math.ceil(1.5));// 2
Math.floor()//向下取整
console.log(Math.floor(1.5));// 1
Math.round()//四舍五入
console.log(Math.round(2.3));// 2