js 数组中取得最大值

来源:互联网 发布:sql server与access 编辑:程序博客网 时间:2024/05/22 10:08

Math.Max.Apply(Math,tmp);

也可以写成

Math.Max.Apply({},tmp);的简写形式


sampleNumList = [1,2,3,4]

var firstMax = Math.max.apply(Math, sampleNumList);//最大值

原创粉丝点击