pick es-toolkit
Returns a new object containing only the properties corresponding to the specified keys.
Usage
pick(obj, keys)
Use pick when you want to select only specific keys from an object. It returns a new object containing only the properties corresponding to the specified keys.
Parameters
objT extends Record<string, any>required
The object to select properties from.
keysreadonly K[]required
An array of keys to select from the object.
Returns
A new object containing only the properties corresponding to the specified keys.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.