js获取数组中最大最小值
JS数组获取值:
var numbers = [5, 458 , 120 , -215 , 228 , 400 , 122205, -85411];
var maxInNumbers = Math.max.apply(Math, numbers);
var minInNumbers = Math.min.apply(Math, numbers);
ES6写法:
let minNum = Math.min(...numbers);
console.log(minNum);