求数组中的最大值

let arr = [5, 6, 2, 3, 99, 8];
let max = Math.max(...arr);
console.log(max); //99

Math.max 不可以直接传入数组,只可以传入一系列数字
发布了39 篇原创文章 · 获赞 2 · 访问量 4020

猜你喜欢

转载自blog.csdn.net/qq_43137725/article/details/104068944
今日推荐