pick
Callable
Type parameters
- T: object | ArrayLike<unknown>
- K: string | number | symbol
Parameters
obj: T
The object to take the properties from.
keys: readonly K[]
The keys to select on the object.
Returns Simplify<Pick<T, K>>
The constructed object.
It takes an object and an array of keys, and returns a new object with only those keys.
Example
Alternatives