Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 635 Bytes

pick.md

File metadata and controls

33 lines (21 loc) · 635 Bytes

objects.pick

pick(object, paths)

Pick returns a new object composed from the selected object properties.

Arguments

  1. object (object): input object
  2. paths (...(string|string[])): paths names of properties to be returned from an object

Returns

(object): object with selected properties

Example

const result = Objects.pick({ a: 'mixed', b34: 'toast', 45: 'pasta' }, 'a', 45);
console.log(result);
> { 45: 'pasta', a: 'mixed' }