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>>
ParamType
objT
The object to read the keys from. required
objT
Partial<T>
required
objT
Partial<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"]