合作联系微信: w6668263      合作联系电话:156-6708-8263     

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  爱记录的龙果果  阅读(314)  评论(0)    收藏  举报

导航