here it is, i cannot find the appropriate way to use the foreach
Array.prototype.myFilter = function(callback) {
const newArray = [];
// Only change code below this line
this.forEach((element in this) => {
if(Boolean(callback(this[i],i,this))){
newArray.push(this[i]);
}
})
// Only change code above this line
return newArray;
};
Since you are referencing i later, how do you make the index of the element available in the forEach method? If you are not sure, then take a look at the documentation.