Note: `Object.assign` mutates its first argument and (with only obscure caveats) does exactly this. Not sure syntax is necessary here.
Oh, and arrays also have the common idiom `array.push(...values)` (but they could use an `Array.prototype.pushAll` to avoid polluting arguments lists). On Wed, Apr 25, 2018, 09:24 Артём Арутюнян <[email protected]> wrote: > I propose *spread assignment operator*: > > *var obj = { test1: 1 };* > *var anotherObj = { test2: 2 };* > *obj ...= { test2: 2 }; // == (obj = { ...obj, ...anotherObj })* > *// { test1: 1, test2: 2 }* > > I'm surprised it wasn't in the original implementation > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

