keys
keys() function
Returns an iterator of the own enumerable property names of object.
Signature:
declare function keys<T extends Record<string, any>>(obj: T): Generator<Extract<keyof T, string>, void, unknown>;
Returns:
Generator<Extract<keyof T, string>, void, unknown>
Example
[...keys({ a: 1, b: "2", c: true })]
// ["a", "b", "c"]