5 ms·
What is `dict()`? What's the meaning of `null`? `undefined` literally means the value is not defined. `null` only has a technical meaning, which says its value
by Gehinnn 7y ago
What is `dict()`? What's the meaning of `null`?
`undefined` literally means the value is not defined.
`null` only has a technical meaning, which says its value is the null pointer.
- Dylan16807 7y agoThat's not what null means in javascript and typescript. There, it's more like 'null' signals that there is no value, and 'undefined' signals that there is no variable.
- Gehinnn 7y agoAll runtime differences are quite neglectable if you use typescript, at least in my experience. You never accidentally use unassigned variables in typescript. Also, `{ x: undefined }` and `{}` are distinguishable. Undefined plays well together with optional fields in typescript, null does not and requries normalization! `undefined` in a JSON array is a problem though.