mirror of
https://github.com/wangdoc/typescript-tutorial.git
synced 2025-12-20 00:50:17 +08:00
docs: fixed typos
This commit is contained in:
@@ -55,8 +55,8 @@ function doStuff(abc: string, xyz: string) {
|
||||
// do some stuff
|
||||
}
|
||||
|
||||
// @ts-expect-error
|
||||
expect(() => {
|
||||
// @ts-expect-error
|
||||
doStuff(123, 456);
|
||||
}).toThrow();
|
||||
```
|
||||
|
||||
@@ -629,7 +629,7 @@ TypeScript 内置的类型描述文件,主要有以下一些,完整的清单
|
||||
- strictPropertyInitialization
|
||||
- noImplicitAny
|
||||
- noImplicitThis
|
||||
- useUnknownInCatchVaria
|
||||
- useUnknownInCatchVariables
|
||||
|
||||
打开`strict`的时候,允许单独关闭其中一项。
|
||||
|
||||
|
||||
@@ -644,7 +644,7 @@ type ReturnType<
|
||||
`ThisParameterType<Type>`提取函数类型中`this`参数的类型。
|
||||
|
||||
```typescript
|
||||
function toHex(this: Number) {
|
||||
function toHex(this:number) {
|
||||
return this.toString(16);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user