const numbers = [5, 12, 8, 23, 6];
const maxValue = Math.max(...numbers);
console.log("数组中的最大值是:" + maxValue);
js取出数组中最大值
最新推荐文章于 2023-11-15 10:28:01 发布
const numbers = [5, 12, 8, 23, 6];
const maxValue = Math.max(...numbers);
console.log("数组中的最大值是:" + maxValue);