Library API
    Preparing search index...

    Function pick

    • Creates a new object composed of the picked object properties.

      Type Parameters

      • T extends object
      • K extends string | number | symbol

      Parameters

      • obj: T

        The source object

      • ...keys: (K | K[])[]

        The property names to pick

      Returns Pick<T, K>

      A new object containing only the picked properties

      const subset = pick({ a: 1, b: 2, c: 3 }, 'a', 'c'); // { a: 1, c: 3 }