Skip to content

xdash API Reference v0.5.14


xdash API Reference / keys

Function: keys() ​

keys<T>(obj): string[]

Defined in: src/object.ts:158

Returns an array of keys from an object.

Type Parameters ​

T ​

T

Parameters ​

obj ​

Record<string, T>

object to get keys from

Returns ​

string[]

an array of keys

Example ​

ts
keys({ a: 1, b: 2 }) // returns ['a', 'b']
keys({ a: 'hello', b: 'world' }) // returns ['a', 'b']

Released under the MIT License.