Array.prototype.myMap = function(callback) {
const newArray = [];
// Only change code below this line
// Only change code below this line
for (let i = 0; i < this.length; i++) {
newArray.push(callback(this[i], i, this));
}
// Only change code above this line
return newArray;
};
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/116.0
Challenge: Functional Programming - Implement map on a Prototype