- Math.radom()生成 [0,1) 的随机数 ```javascript let num = Math.random()
//返回[0,9)的随机数 let num = parseInt(Math.random() * 9)
//返回[1,10]的随机数 let num = parseInt(Math.random() * 10) + 1
2. 舍入
1. 向上取整
```javascript
let num = Math.ceil(1.4);
console.log(num);
//2
向下取整
let num = Math.floor(1.4);
console.log(num);
//1
标准四舍五入
let num = Math.round(1.4)
console.log(num);
//1
let num = Math.round(1.5)
console.log(num);
//2
次方
let num = Math.pow(2, 2)
console.log(num);
//4
绝对值
let num = Math.abs(-2)
console.log(num);
//2
平方根
let num = Math.sqrt(4)
console.log(num);
//2
最大值
let num = Math.max(1, 2, 3, 10, 100, 300)
console.log(num);
//300
最小值
let num = Math.min(1, 2, 3, 10, 100, 300)
console.log(num);
//1