Map is used when you want to modify data in some list or array and return a new modified array from that original array.

I’m really enjoying cryptocurrency and all the fanfare that comes with it, so let’s use an array of crypto prices in our code example.

Let’s:

  1. iterate through the array
  2. pull out all the prices which happen to be the second property of each currency object
  3. save these prices into a prices array

Categories: JavaScript