Skip to main content

pick

_.pick(paths, object) # Ⓢ [Ⓣ][1] Ⓝ

Creates an object composed of the picked object properties.

Since​

0.1.0

Arguments​

  1. paths (string|string[]): The property paths to pick.
  2. object (Object): The source object.

Returns​

(Object): Returns the new object.

Example​

var object = { 'a': 1, 'b': '2', 'c': 3 };

_.pick(['a', 'c'], object);
// => { 'a': 1, 'c': 3 }