枚举

用于命名一组数值的类型:

数值默认为 0:

enum Day { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday };
let bestDay: Day = Day.Saturday;

设置默认起始编号:

enum TenPlus { Ten = 10, Eleven, Twelve }

或指定值:

enum MyOddSet { Three = 3, Five = 5, Seven = 7, Nine = 9 }