What is going on here, everything has been chill and a little bit complicated at times. But, suddenly this module just seems to be off on a different planet and assuming lots of prior knowledge which wasnt covered.
Is there a separate guide/resource I should be using to explain these concepts at this point?
The one I am specifically talking about is on number 8 - using array.prototypes, and one of the prior ones was about prototypes too, but they seem to be in a completely different context to the object prototypes used in the previous module.
Yea, that’s the idea. You need to add a new method to the prototype for all arrays called myMap(), and this function should return a new array that has contents given by applying the callback() function to the contents of this instance of an array.
Just for clarification, is the callback(), the function which is written as part of myMap(), or is the callback the function which is declared as part of ‘const new_s’ (the *2 function.?
So, both myMap() and .map() should produce new_s == [46, 130, 196, 10].
But, the callback() passed in to .map() or .myMap() can be any function that takes an array item and returns a new value to place in the new array. If we use this other callback function
Thank you, I have been banging my head against a wall and started the module again reading a lot of details about each one with no pressure… it clicked! Thanks for the help on this one. It is a little bit mind-bending at first but it’s great when learning stuff and something finally clicks! Let’s see what I end up banging my head against next!