Skip to content

docs: update description #6

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

Merged
merged 1 commit into from
Aug 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/array.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ arr.push(123);
arr.push('abc');
```

上面示例中,数组变量`arr`的初始值是空数值,然后随着新成员的加入,TypeScript 会自动修改推断的数组类型。
上面示例中,数组变量`arr`的初始值是空数组,然后随着新成员的加入,TypeScript 会自动修改推断的数组类型。

但是,类型推断的自动更新只发生初始值为空数组的情况。如果初始值不是空数组,类型推断就不会更新。

Expand Down