To some extent I am completing this exercise a bit blind. In the previous exercises I have been able to complete them but have not really understood. I think it is the same with this exercise.
Any assitance welcome
With the newArray = oldArray isn’t necessary as that is just a pointer reference to the oldArray, so it’s actually the same array. You just need to have var newArray = oldArray.filter()=>
You can check this by entering your oldarray in console and setting your newArray to it like you did here. Try changing newArray and you will see it changes your oldArray too!
I see that the initial question is answered, but I would like to ask another question related to this challenge, or how it can be solved on FCC. How come on MDN the callback is not needed for this method to run, or I am missing something?
I tried to simplify the solution on FCC, but it throws back an error that “val” is not defined.
Actually, it dawned on me It’s an arrow function, that’s why… Well, then another question would be, why can’t we use ES2015 functionality in FCC solutions? That kinda sets us back on our learning curve…