码迷,mamicode.com
首页 > 其他好文 > 详细

最大(小)值

时间:2020-06-22 01:27:03      阅读:48      评论:0      收藏:0      [点我收藏+]

标签:扩展   const   console   pre   bsp   min   null   class   apply   

 

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) 

 

最大(小)值

标签:扩展   const   console   pre   bsp   min   null   class   apply   

原文地址:https://www.cnblogs.com/MrZhujl/p/13174508.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!