react typescript convert string to enum number code example
Example: typescript string to enum
enum Day {
BeforeNoon = "AM",
AfterNoon = "PM"
}
var beforeNoon : string = "AM";
var enumValue : Day = (<any>Day)[beforeNoon];
enum Day {
BeforeNoon = "AM",
AfterNoon = "PM"
}
var beforeNoon : string = "AM";
var enumValue : Day = (<any>Day)[beforeNoon];