Math.floor();向下取整
Math.ceil();向上取整
Math.round();四舍五入
Math.abs();去绝对值
Math.max()/min();取最小值
const array = [0, 1, 2, 3, 4, 15, 6];
console.log(Math.max(...array)); //注意
或
console.log(Math.max(0, 1, 2, 3, 4, 15, 6));
随机数方法:random()
Math.floor();向下取整
Math.ceil();向上取整
Math.round();四舍五入
Math.abs();去绝对值
Math.max()/min();取最小值
const array = [0, 1, 2, 3, 4, 15, 6];
console.log(Math.max(...array)); //注意
或
console.log(Math.max(0, 1, 2, 3, 4, 15, 6));
随机数方法:random()