[Map/Set] Add an .update() method, a la Python?

Tab Atkins Jr. jackalmage at gmail.com
Thu Jun 27 16:47:03 PDT 2013

Has it been discussed yet to add an .update() method to Map and Set, a
la Python, which take an iterable (yielding [key, value] for Map, and
just value for Set) and add the iterable's entries to the Map/Set?

It desugars easily:

Map.prototype.update = function(iter) {
Set.prototype.update = function(iter) {

I've used this kind of dict/set addition in Python plenty, and added
the method to my Map polyfill that I use for some personal projects.



More information about the es-discuss mailing list