I believe the reason was that there didn't seem to be a need or the use cases to justify adding it. This issue should have more information (I haven't read it fully myself):
opened 07:21AM - 24 Jul 17 UTC
closed 01:56PM - 13 Nov 17 UTC
out of scope / maybe later
For the most general case illustrating short-circuiting, the instruction:
```js…
a?.b.c().d = e;
```
is equivalent to:
```js
if (a != null)
a.b.c().d = e;
```
@alangpierce has found real-world usages of that form in CoffeeScript, some of them seem reasonable, including two-level deep chains `a?.b.c = d`:
https://gist.github.com/alangpierce/34b7aa40cda51b0a089a44680bdfed7e
Should we include that? In particular, are the semantics clear enough? There are the following subcases:
* simple assignment: `a?.b = c`
* combined assignment: `a?.b += c`, `a?.b >>= c`, etc.
* increment/decrement: `a?.b++`, `--a?.b`, etc.
* destructuring assignment: `{ x: a?.b } = c`, `[ a?.b ] = c`, etc.
* for-in/of loop header: `for (a?.b in c)`, `for (a?.b of c)`
There is a separate proposal for adding support for it though:
1 Like