`??=` is being merged into the Logical Assignment Operator proposal, and the overall proposal will wait until nullish coalescing is finalized.
5 lines
42 B
JavaScript
5 lines
42 B
JavaScript
let o;
|
|
o ??= {};
|
|
o.a ??= 1;
|
|
o["b"] ??= 2;
|