📜  typescript string to enum - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:18.456000             🧑  作者: Mango

代码示例2
enum Day {
    BeforeNoon = "AM",
    AfterNoon = "PM"
} 

var beforeNoon : string = "AM";
var enumValue : Day = (Day)[beforeNoon];