标签:
Array.prototype.filter = function(fn){
for(var i =0; i < this.length; i++){
if(!fn(this[i], i)){
this.splice(i--, 1);
}
}
return this;
}
var b = [1,2,3,4,5];
b.filter(function(v){
return v > 3;
});
console.log(b);
标签:
原文地址:http://www.cnblogs.com/w-rudolph/p/4507629.html