The numeric enum to retrieve keys for
An ordered array of all of enumType
's string keys
enum fruit {
apple = 1,
banana = 2,
cherry = 3,
orange = 12,
};
console.log(getEnumKeys<typeof fruit>(fruit)); // output: ["apple", "banana", "cherry", "orange"]
To retrieve the keys of a NormalEnum
, use Object.keys instead.
Return the string keys of an Enum object, excluding reverse-mapped numbers.