You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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