Post #908226
2023-07-13 15:54 UTC
Oh, this proposal from @nic looks a great improvement! Now at Stage 1.
Instead of:
```js
if (obj) obj.prop = value;
```
we could get a optional chaining assignment:
```js
obj?.prop = value
```
https://github.com/nicolo-ribaudo/proposal-optional-chaining-assignment
Replies (3)
-
@orta@m.webtoo.ls 2023-07-13 21:35
@patak @nic nice work, wanted that a few times!
-
@Shini92@mas.to 2023-07-15 11:38
@patak @nic Will deep nested also work? ``` let obj = null; obj?.prop?.deepProp = 1; ```
-
@sirdorius@mastodon.gamedev.place 2023-07-19 09:53
@patak @nic Nice, exactly what I was looking for a few days ago