Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aac1467

Browse files
authored
Update primitive-data-types.md (xcatliu#209)
null 只有在 --strictNullChecks 配置未指定时才能赋值给 void 变量
1 parent 3be9f5a commit aac1467

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

basics/primitive-data-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function alertName(): void {
104104
}
105105
```
106106

107-
声明一个 `void` 类型的变量没有什么用,因为你只能将它赋值为 `undefined``null`
107+
声明一个 `void` 类型的变量没有什么用,因为你只能将它赋值为 `undefined``null`(只在 --strictNullChecks 未指定时)
108108

109109
```ts
110110
let unusable: void = undefined;

0 commit comments

Comments
 (0)