-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript 学习笔记 #105
Comments
基本类型
类型断言通过类型断言这种方式可以告诉编译器,“相信我,我知道自己在干什么” 它没有运行时的影响,只是在编译阶段起作用。 TypeScript会假设你,程序员,已经进行了必须的检查。
接口
类
函数
枚举enum Response {
No = 0,
Yes = 1,
}
function respond(recipient: string, message: Response): void {
// ...
}
respond("Princess Caroline", Response.Yes) 枚举可以作为一个对象使用
泛型 |
细节
The text was updated successfully, but these errors were encountered: