Functional Programming: Implement map on a Prototype - .myMap

Write your own Array.prototype.myMap(), which should behave exactly like

How is it that js understands myMap() the same as .map()? Would .yourMap() also work? How does js interpret them as the same?

It will only work the same if you write the code that creates the same functionality.

For example, I should be a to call your myMap method on any array I choose and supply a function of my choosing and your myMap should return the same array as the built-in map method would if supplied with the same array and function.

If I read you correctly it’s the format of the function that describes it as the map method?
Does it matter if the word “map” is in the naming or is it just for clarity?

Not sure what you mean by “format”. The code you write must provide the same functionality (result) as the built-in map method.

Strictly for clarity. You can name the method SantaClaus if you want.

Thank you…
I’ll have to read your comments over a few times to let it sink in to my old brain :slight_smile: