Mapping collections

In this section, we'll explore mapping collections. Mapping one collection to another ranges from composing simple—as we saw in the preceding section—to sophisticated callbacks. Callbacks that map each item in the collection can include or exclude properties and can calculate new values. We'll also address the issue of filtering collections and how this can be done in conjunction with mapping.

Including and excluding properties

When applied to an object, the pick() function generates a new object containing only the specified properties. The opposite function, omit(), generates an object with every property except those specified. Since these functions work fine for individual object instances, why not use them with a collection? ...

Get Lo-Dash Essentials now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.