1 教程
深入浅出TypeScript juejin.cn/course/byte…
其他
juejin.cn/course/byte… juejin.cn/course/byte…
2 为什么要学TS
TypeScript是JavaScript的超集。
推荐
www.typescriptlang.org/play?#code/…
3 TS基础
3.1 基础类型
boolean、number、string enmu枚举(ts) undefine、null any、unknow(只允许被赋值)、void never(ts) 数组[] 元组 tuple
3.2 函数类型
3.3 接口(interface)
3.4 类
增加了public、priavte、protected修饰符 抽象类
4 TS进阶
4.1 高级类型
别名type
4.2 泛型
泛型
function print<T>(arg:T):T{
console.log(arg)
return arg
}
print<string>('hello')
print('hello')
5 实战&工程向
声明文件
泛型约束后端接口类型
6 思考
得动手多练习