Tell us what’s happening:
I’ve figured out that i probably will need a for loop for this with .this, but how to proceed?
Your code so far
Array.prototype.myFilter = function(callback) {
const newArray = [];
// Only change code below this line
for (let i = 0; i < this.length; i++) {
}
// Only change code above this line
return newArray;
};
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:107.0) Gecko/20100101 Firefox/107.0
Challenge: Functional Programming - Implement the filter Method on a Prototype
Link to the challenge: