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
While `null` means "no object", `undefined` is "no value".
4
+
5
+
The simple way for typecheck both value is using weak equal:
6
+
7
+
```js
8
+
constisNil=value=> value ==null
9
+
```
10
+
11
+
Although the problem is still there: everyone uses `null` and `undefined` inconsistently and interchangeably, not being clear when to use which.
12
+
13
+
We cannot remove `null` from JavaScript (e.g., JSON doesn't support `undefined`) but we can mitigate the impact.
14
+
15
+
In order to apply a simple rule there, just [use `undefined` over `null`](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines#null-and-undefined).
0 commit comments