# Why did you block this?

**URL:** <https://es.discourse.group/t/why-did-you-block-this/2089>\
**Category:** I have questions\
**Created:** [July 16, 2024, 9:09am UTC](https://es.discourse.group/t/why-did-you-block-this/2089 "2024-07-16T09:09:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![oleedd](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/oleedd/32/2148_2.png) [@oleedd](https://es.discourse.group/u/oleedd)\
**Post date:** [July 16, 2024, 9:09am UTC](https://es.discourse.group/t/why-did-you-block-this/2089/1 "2024-07-16T09:09:58Z")

</div>

```javascript
var a = [];
a?.b = 4;

```

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/senocular/32/642_2.png) [@senocular](https://es.discourse.group/u/senocular)\
**Post date:** [July 16, 2024, 11:56am UTC](https://es.discourse.group/t/why-did-you-block-this/2089/2 "2024-07-16T11:56:16Z")

</div>

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):

> <https://github.com/tc39/proposal-optional-chaining/issues/18>
>
> 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:

> **[GitHub - tc39/proposal-optional-chaining-assignment: \`a?.b = c\` proposal](https://github.com/tc39/proposal-optional-chaining-assignment)**
>
> \`a?.b = c\` proposal. Contribute to tc39/proposal-optional-chaining-assignment development by creating an account on GitHub.
