5 ms·
Given null is generally non-idiomatic in JS (it's there, but most best practices say to avoid it) I think that's likely by design. However the `a?.b` form is c
by abritinthebay 9y ago
Given null is generally non-idiomatic in JS (it's there, but most best practices say to avoid it) I think that's likely by design.
However the `a?.b` form is coming (it's not just null propagation, it's an Existence Operator). It's called "optional chaining"
https://github.com/tc39/proposal-optional-chaining https://github.com/tc39/proposal-optional-chaining
- smilekzs 9y ago> I think that's likely by desig Fine. s/null/undefined The problem still exists.
- abritinthebay 9y agoI think calling it a problem is a bit melodramatic. A cleaner syntax is nice for sure, but it’s not exactly unworkable as is (and promotes flatter data, generally a good thing). But yes, it’ll be nice if/when the new syntax drops.