let arr = [3,2,4,1,8,6] let maxValue = Math.max.apply(null,arr); console.log(maxValue);
PS: Math.max()中的参数不可以传数组
let arr = [3,2,4,1,8,6] let maxValue = Math.max(...arr); console.log(maxValue);
let arr = [3,2,4,1,8,6] let maxValue = Math.max.apply(null,arr); console.log(maxValue);
PS: Math.max()中的参数不可以传数组
let arr = [3,2,4,1,8,6] let maxValue = Math.max(...arr); console.log(maxValue);
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。