1 Star 0 Fork 0

EastM/learn-typescript

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
enums.ts 301 Bytes
Copy Edit Raw Blame History
EastM authored 2020-06-19 11:04 . 基本巩固完毕
enum direction {
up,
down,
left,
right,
}
//常量枚举 ,可以提升性能,它只会编译为逻辑部分的js代码
const enum LIKE {
RED = 'red',
GREEN = 'green'
}
const value:string = 'red';
if(value === LIKE.RED) {
console.log(`i like ${value}`)
}
console.log(direction.up)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/EastM/learn-typescript.git
git@gitee.com:EastM/learn-typescript.git
EastM
learn-typescript
learn-typescript
master

Search