pick source npm
_.pick(object, [props])
Creates an object composed of the picked object
properties.
Arguments
- object (Object)
The source object.
- [props] (...(string|string[])
The property names to pick, specified individually or in arrays.
Returns (Object)
Returns the new object.
Example
var object = { 'user': 'fred', 'age': 40 };
_.pick(object, 'user');
// => { 'user': 'fred' }