#14 Map Arrays

Emad Ibrahim
Jun 16, 2016 · 1 min read

You can “convert” your array of objects into another array of different objects. Lets say your first array contains a list of complex user models but you only care about the username and email properties for a certain action. You could map the array like this.

Or if you had an array of numbers and you wanted to double each item, you could do:

Originally published at Ember Daily Tips.

    Emad Ibrahim

    Written by

    Husband, Father of Twins, Published Author, Entrepreneur, Passionate Technologist, Programmer and Productivity Nut. more at https://about.me/eibrahim