js数组方法扩充达成数组计算函数_幼功知识_脚本

2019-12-29 作者:亚洲城动态   |   浏览(85)

复制代码 代码如下:/*****************************************************CreateBy:joe zhou*Description:数组统计函数****************************************************/$.extend {return cacl(arr, function {if {return item;}else {return max;}});},min: function {return cacl(arr, function {if {return item;}else {return min;}});},sum: function {return cacl(arr, function {if == 'undefined') {return item;}else {return sum = item;}});},avg: function {if == 'undefined' || arr.length == 0) {return 0;}return this.sum;$.fn.extend {return $.max;},min: function () {return $.min;},sum: function () {return $.sum;},avg: function () {return $.avg;function cacl {var ret;for (var i=0; i

本文由yzc216亚洲城发布于亚洲城动态,转载请注明出处:js数组方法扩充达成数组计算函数_幼功知识_脚本

关键词: 亚洲城官网 yzc216亚洲城