The type of the object from which keys will be picked.
The keys of the object to be picked.
A new object containing only the specified keys.
const original = { a: 1, b: 2, c: 3 };
const result = pickObjectKeys(original, ['a', 'c']);
console.log(result); // { a: 1, c: 3 }
const user = { name: 'Alice', age: 25, country: 'USA' };
const pickedData = pickObjectKeys(user, ['name', 'age']);
console.log(pickedData); // { name: 'Alice', age: 25 }
Creates a new object containing only the specified keys from the original object. This function avoids mutating the original object by creating a new object.