需要合作伙伴联系我,VX(绿泡泡): w6668263      email:ye583025823@126.com

javascript获取数组种最大值?

Array.prototype.max = function () {
    return Math.max.apply({}, this)
}


Array.prototype.min = function () {
    return Math.min.apply({}, this)
}

 

例如:

[1,2,3].max()// => 3
[1,2,3].min()// => 1

 

技术交流QQ群:15129679

posted on 2016-10-09 13:14  龙行龘龘9527  阅读(306)  评论(0编辑  收藏  举报

导航