Return a copy of the object only containing the whitelisted properties.
var foo = { a: 1, b: 2, c: 3 };var ab = pick(foo, ['a', 'b']); // { a: 1, b: 2 } Copy
var foo = { a: 1, b: 2, c: 3 };var ab = pick(foo, ['a', 'b']); // { a: 1, b: 2 }
the source object
an Array of strings, which are the whitelisted property names
Return a copy of the object only containing the whitelisted properties.
Example: