- Instant help with your JavaScript coding problems
keys
The Object.keys() method returns an array of a given object's own enumerable property names, iterated in the same order that a normal loop would.
JavaScript:
Object.keys(obj)
TypeScript:
keys(o: {}): string[];
Examples:
const obj = { 0: 'a', 1: 'b', 2: 'c' };
console.log(Object.keys(obj)); // console: ['0', '1', '2']

Related snippets