|
|
|
|
|
by bcherny
3000 days ago
|
|
This is a really neat idea, and is a lot more ergonomic than nulls or optionals in JS. Until optional chaining makes its way into the spec [0], this is the cleanest way I’ve seen to operate on maybe-null values. [0] https://github.com/tc39/proposal-optional-chaining |
|
It's good for unit testing though.