Functional Programming - Implement map on a Prototype

Tell us what’s happening:
Describe your issue in detail here.

Hello, I am not able to understand the question and stuck like how can I proceed further. Looking for explanation in details so that I can get started. Don’t want to look at solution without understanding anything.

Your code so far

Array.prototype.myMap = function(callback) {
  const newArray = [];
  // Only change code below this line

  // Only change code above this line
  return newArray;

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Functional Programming - Implement map on a Prototype

Link to the challenge:

You are going to loop over the contents of an array, to mimic the functionality of the map() method. Basically to understand map() you are going to write your own version of it.

1 Like

You are reinventing the wheel for )

I learnt it by going thru both hint solution, then redo this another day. Try not to memorize but understand it. :laughing:

1 Like

I strongly recommend against looking up the answers instead of writing your own answer. The whole idea of the challenges is to practice working through problems you haven’t solved before.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.