API Reference

Returns an object with only the specific keys included.

function pickKeys<T extends object, U extends keyof T>(obj: T, ...keys: U[]) // Example: const obj = { a: 1, b: 2, c: 3 } pickKeys(obj, "a", "c") //=> { a: 1, c: 3 }