To use the keys function from the underscore library in Typescript, you need to first install the underscore library using npm:
index.ts30 chars2 lines
Then, you need to install the type definitions for underscore:
index.ts41 chars2 lines
With the underscore library and its type definitions installed, you can import and use the keys function in your Typescript code:
index.ts188 chars11 lines
The keys function takes an object as its argument and returns an array of the object's own enumerable property names, in the same order as the for...in
loop would give.
gistlibby LogSnag