(@_@;)我是程序猿,我编程,我快乐,知识改变命运,技术成就梦想   oh yeah!合作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  一个草率的龙果果  阅读(306)  评论(0编辑  收藏  举报

导航