Showing posts with label pick. Show all posts
Showing posts with label pick. Show all posts

Monday, April 28, 2014

Lodash: Picking Object Properties to Extend

The extend() function is one of those Lodash tools that's so indispensable, you wonder how the core JavaScript language doesn't have something similar built-in. There's another Lodash function I'm developing similar feelings toward — pick(). This function operates on objects, and returns a new object, containing only properties "picked" from the source object. Something like this comes in handy when extending objects.