最大(小)值

 

const arr = [1,2,3,4,5,6]
//const max =  Math.max(...arr) //可以用扩展运算符,也可以利用apply的特性
const max = Math.max.apply(null, arr)//Math.min  最小值
console.log(max) 

 

posted @ 2020-06-21 22:59  真的想不出来  阅读(144)  评论(0编辑  收藏  举报