Creates a new object by picking only the specified properties from the original object.
function pick<T extends object, K extends string | number | symbol>( instance: T, keys: K[]): Pick<TK>Pick<T, K>Creates a new object by picking only the specified properties from the original object.
TK[]Pick<T, K>Creates a new object by picking only the specified properties from the original object.
This function returns a new object that contains only the properties specified
in the keys parameter from the original object.
const user = { id: 1, name: 'John', email: '[email protected]', password: 'secret' };
// Pick single property
const nameOnly = pick(user, ['name']);
const user = { id: 1, name: 'John', email: '[email protected]', password: 'secret' };
const publicInfo = pick(user, ['id', 'name', 'email']);
// Result: { id: 1, name: 'John', email: '[email protected]' }
