Skip to content

Commit aec57f5

Browse files
Basarat Ali SyedBasarat Ali Syed
authored andcommitted
wip strict null checks
1 parent 6b55e49 commit aec57f5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/options/strictNullChecks.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## `strictNullChecks`
2+
By default `null` and `undefined` are assignable to all types in TypeScript e.g.
3+
4+
```ts
5+
let foo: number = 123;
6+
foo = null; // Okay
7+
foo = undefined; // Okay
8+
```
9+
10+
This is modelled after how a lot of people write JavaScript. However like all things TypeScript allows you to be *explicit* about what *can and cannot be* assigned a `null` or `undefined`.

0 commit comments

Comments
 (0)