📜  枚举值中的打字稿类型 - TypeScript 代码示例

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

代码示例4
enum Number {
  One,
  Two
}  

const numberOne: Number = "One" as Number;
const otherNumberOne: Number = Number.One;

const stringOne = Number[Number.One];