79254328

Date: 2024-12-05 10:49:54
Score: 1
Natty:
Report link

There is a proposal to allow optional chaining assignments which would allow you to do:

obj?.someProp = 42;

It won't check for existence of someProp, just obj.

Proposal: https://github.com/tc39/proposal-optional-chaining-assignment

It is implemented in babel, so you could use that already if transpiling.

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: m10