common-stuff
    Preparing search index...

    Function pick

    • Returns a new object containing only the given keys from obj.

      Missing keys are omitted from the result rather than producing undefined-valued properties.

      Type Parameters

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

      Parameters

      • obj: T
      • keys: readonly K[]

      Returns Pick<T, K>

      pick({ a: 1, b: 2, c: 3 }, ['a', 'c'])
      // { a: 1, c: 3 }