js查找数组的最大值和最小值

const arr = [1, 2, 3]; 
Math.max(…arr); // 3
Math.min(…arr); // 1

 

posted @ 2022-01-02 18:43  程序员小明1024  阅读(176)  评论(0编辑  收藏  举报