Function pick

  • Creates an object composed of the picked object properties.

    Parameters

    • object: any

      The source object.

    • Rest ...paths: Path[]

      The property paths to pick.

      Rest

    Returns any

    Returns the new object.

    Since

    5.7.0

    Example

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

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