1enum AnEnum {
2 One = 1,
3 Two = 2
4}
5let stringOne = AnEnum[1]; // "One"
6let stringTwo = AnEnum[AnEnum.Two]; // "Two"
1enum Day {
2 BeforeNoon = "AM",
3 AfterNoon = "PM"
4}
5
6var beforeNoon : string = "AM";
7var enumValue : Day = (<any>Day)[beforeNoon];