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.
- iterate through the array
- pull out all the prices which happen to be the second property of each currency object
- save these prices into a prices array