DEV Community

Discussion on: You don't need null

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

There would be more of a case for null/undefined as separate values if something like this:

{key: "value", ...{key: undefined}}
Enter fullscreen mode Exit fullscreen mode

actually worked, that is, returned {key: "value"}; but instead, JS still treats undefined in the second object as different from not setting a value at all, which makes this whole distinction very pointless.

Some comments have been hidden by the post's author - find out more