"Short-circuiting" feature (original) (raw)
In this proposal, as the explainer says,
a?.b.c().d // undefined if a is null/undefined
The "short-circuiting" semantics received some criticism at the previous TC39 meeting where the proposal was discussed. A few committee members (including Waldemar Horwat) expressed a preference that this would throw (on the access to .c) to keep the semantics simple and more locally understandable, and refrain from changing .
. The explainer talks about the "right hand side", but where does the right hand side end exactly?
If you don't plan to remove this feature, it would be useful to extend the explainer with some more motivating use cases.