Creates a new object composed of the specified keys from the input object.
The type of the source object.
The keys to pick from the source object.
The source object to pick properties from.
An array of keys to include in the returned object.
A new object with only the specified keys.
const user = { id: 1, name: 'Alice', age: 30 }const result = pick(user, ['id', 'name'])// result: { id: 1, name: 'Alice' } Copy
const user = { id: 1, name: 'Alice', age: 30 }const result = pick(user, ['id', 'name'])// result: { id: 1, name: 'Alice' }
Creates a new object composed of the specified keys from the input object.