enum Direction{
Up="Up",
Down="Down",
Left="Left",
Right="Right"
}
console.log(Direction.Up)//0
console.log(Direction[0])//Up
// 常量枚举 可以提升性能
const value='Up'
if(value==Direction.Up){
console.log("go up")
}
标签:Direction,console,14,Enum,Up,枚举,react18,log
From: https://www.cnblogs.com/yao-655442/p/16629133.html