Options
All
  • Public
  • Public/Protected
  • All
Menu

Module pick

Index

Functions Object

Object Functions

  • pick(object: any, ...paths: Path[]): any
  • Creates an object composed of the picked object properties.

    since

    5.7.0

    example
    const object = { 'a': 1, 'b': '2', 'c': 3 }

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

    Parameters

    • object: any

      The source object.

    • Rest ...paths: Path[]

      The property paths to pick.

    Returns any

    Returns the new object.