mirror of
https://github.com/wangdoc/typescript-tutorial.git
synced 2025-12-23 02:14:38 +08:00
fix:typo
This commit is contained in:
@@ -312,7 +312,7 @@ type T = Obj[string];
|
||||
这个语法对于数组也适用,可以使用`number`作为方括号的参数。
|
||||
|
||||
```typescript
|
||||
// MyArray 的类型是 { [key:number]:string }
|
||||
// MyArray 的类型是 { [key:number]: string }
|
||||
const MyArray = ['a','b','c'];
|
||||
|
||||
// 等同于 (typeof MyArray)[number]
|
||||
|
||||
Reference in New Issue
Block a user