Array.prototype.myMap = function(callback){ let arr = new Array(this.length) for(let i = 0;i < this.length;i++){ let item = this[i] if(this.indexOf(item,i) === i){ arr[i] = callback(item,i,this) } } return arr }