自写forEach()
Array.prototype.myForEach = function(callback){
for(var i=0;i<this.length;i++){
callback(this[i],i,this);
}
}
自写map()
Array.prototype.myMap = function(callback){
var newArr = new Array();
for(var i=0;i<this.length;i++){
return newArr = callback(this[i],i,this);
}
}