Home > @wixc3/common > pick
returns an object composed of the picked object properties
Signature:
export declare function pick<O extends object, K extends keyof O>(record: O, keys: Iterable<K>): Pick<O, K>;
Parameter | Type | Description |
---|---|---|
record | O | |
keys | Iterable<K> |
Returns:
Pick<O, K>
pick({ a: 1, b: 2 }, ['a']) // => { a: 1 }