getKeys()function
getKeys(obj: T): ImmutableArray<Key<T>>
getKeys(obj: T | Partial<T>): ImmutableArray<Key<T>>
getKeys(obj: T | Partial<T> | Iterable<Key<T>>): Iterable<Key<T>>
| Param | Type | |
|---|---|---|
obj | T | The object to read the keys from. required |
obj | TPartial<T> | required |
obj | TPartial<T>Iterable<Key<T>> | required |
| Return | |
|---|---|
ImmutableArray<Key<T>> | Iterable set of keys for the object. |
ImmutableArray<Key<T>> | Immutable array: an array that cannot be changed. |
Iterable<Key<T>> |
Get the keys of an object as an array.
Examples
getKeys({ a: 1, b: 2 }); // ["a", "b"]