Given an a TypeScript enum:
export enum Color {
Red,
Green,
Blue,
}
I want to get all its values in an array like so:
["Red", "Green", "Blue"]
Yet when I work on that enum with
const colors = Object.keys(Color);
I get weird array consisting of its index and value:
[ '0', '1', '2', 'Red', 'Green', 'Blue' ]
Why is this the case and how can I only get the values?