pick
Creates a new object with only the specified keys.
Available since v2.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
obj | T | The source object |
keys | readonly K[] | The keys to pick |
Returns
Section titled “Returns”Pick<T, K> — A new object with only the picked keys
Examples
Section titled “Examples”Pick specific keys
Section titled “Pick specific keys”Creates a new object with only the specified keys.
Extract user fields
Section titled “Extract user fields”Useful to select only the fields you need from an object.
