Proposal: Map#assign

Gil Tayar gil at tayar.org
Thu Jan 18 18:59:28 UTC 2018


I believe there's a very simple way to do this today: new Map([...mapA,
...mapB, ...mapC]).

Almost as nice as map.assign :-)

- Gil Tayar

On Thu, Jan 18, 2018 at 8:12 PM T.J. Crowder <
tj.crowder at farsightsoftware.com> wrote:

> On Thu, Jan 18, 2018 at 6:08 PM, Mike Samuel <mikesamuel at gmail.com> wrote:
> >
> > What if, instead of a variety of assign methods, we respeced
> > Object.assign to do this given a Map as the left-value?
>
> I think even if one posits that that would have been a good idea when
> `Object.assign` was defined, the ship has sailed. Code in the wild setting
> custom properties on `Map` instances using `Object.assign` would suddenly
> break.
>
> -- T.J. Crowder
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180118/b06e19be/attachment.html>


More information about the es-discuss mailing list