Following code can be used to create an enum
in TypeScript:
enum e {
hello = 1,
world = 2
};
And the values can be accessed by:
e.hello;
e.world;
How do I create an enum
with string values?
enum e {
hello = "hello", // error: cannot convert string to e
world = "world" // error
};