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
(@_@;)我是程序猿,我编程,我快乐,知识改变命运,技术成就梦想 oh yeah!合作VX "w6668263" 联系Email:ye583025823@126.com
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