Skip to content

Commit 7408e52

Browse files
author
Orta
authored
Merge pull request microsoft#1096 from wataash/void-strict-null-checks
Emphasize that void accepts null unless strictNullChecks
2 parents 42f148c + 8778da1 commit 7408e52

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pages/Basic Types.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,11 @@ function warnUser(): void {
179179
}
180180
```
181181

182-
Declaring variables of type `void` is not useful because you can only assign `undefined` or `null` to them:
182+
Declaring variables of type `void` is not useful because you can only assign `null` (only if `--strictNullChecks` is not specified, see next section) or `undefined` to them:
183183

184184
```ts
185185
let unusable: void = undefined;
186+
unusable = null; // OK if `--strictNullChecks` is not given
186187
```
187188

188189
# Null and Undefined

0 commit comments

Comments
 (0)