数组部分算法重构
1.Every
1 | Array.prototype.myEvery = function(handler){ |
2.Some
1 | Array.prototype.mySome = function(handler){ |
3.foreach
1 | Array.prototye.myForEach = function(handler){ |
4.filter
1 | Array.prototype.myFilter = function(handler){ |
5.map
1 | Array.prototype.myMap = function(handler){ |
6.sort(加函数版)
1 | Array.prototype.mySort = function(handler){ |
7.pop
1 | Array.prototype.myPop = function(){ |
8.push
1 | Array.prototye.myPush = function(){ |
9.shift
1 | Array.prototype.myShift = function(){ |
10.unshift
1 | Array.prototype.myUnshift = function(){ |
发布于