enum Color {Red, Green, Blue};var Color;(function (Color) { Color[Color["Red"] = 0] = "Red";
Color[Color["Green"] = 1] = "Green";
Color[Color["Blue"] = 2] = "Blue";})(Color || (Color = {}));這是typescript里enum類型的源碼,看不懂Color[Color["Red"] = 0] = "Red"這什么意思?
Color[Color["Red"] = 0] = "Red";怎么解釋?
滄海一幻覺
2018-10-10 10:19:06