02静态检查
# 静态检查
ts只会在编译时进行静态检查,
如果有错误,会直接报错,
但是即使报错了,仍然会生成编译结果。
//index.ts
function hello(person:string){
console.log(person)
}
hello(123)
//index.js
function hello(person) {
console.log(person);
}
hello(123);
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
编辑 (opens new window)
上次更新: 2023/08/06, 00:38:41