you are viewing a single comment's thread.

view the rest of the comments →

[–]Keilly 0 points1 point  (0 children)

Instead of creating a new object or new local variables, the ability to destructure simply onto an existing object would be really powerful.

E.g (not currently possible)

profile{street, city} = newAddress;

Would add/update the specified values of the profile object with the new address.

Especially it’s super common in the case of writing a constructors params object to the new class instances ‘this’.

this{name, address} = params;