Returns a new object containing only the specified keys.
The source object.
An array of keys to include in the new object.
A new object with only the specified keys.
const obj = { a: 1, b: 2, c: 3 };const result = pick(obj, ["a", "c"]);console.log(result); // { a: 1, c: 3 } Copy
const obj = { a: 1, b: 2, c: 3 };const result = pick(obj, ["a", "c"]);console.log(result); // { a: 1, c: 3 }
1.1.0
Returns a new object containing only the specified keys.