Image Image Image Image Image
Scroll to Top

To Top

JavaScript

15

Apr
2018

No Comments

In JavaScript

By Manny

JavaScript map array helper method

On 15, Apr 2018 | No Comments | In JavaScript | By Manny

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