Hi.

With Set methods being discussed on next TC39 I would like to write second
proposal - Map methods.

Currently I thought about:

Map.prototype.filter(cb, thisArg)
Map.prototype.mapValues(cb, thisArg)
Map.prototype.mapKeys(cb, thisArg)
Map.prototype.merge(iterable: Iterable.<Tuple.<*, *>>)

Map.groupBy(iterable, keyDerivativeFunc) - analogus to lodash.groupBy
<https://lodash.com/docs/4.17.4#groupBy>, but returning Map Instance.
Map.keyBy(iterable, keyDerivativeFunc) - analogous to lodash.keyBy, but
returning Map instance.

I spend few minutes on writing code for simple polyfill -
https://github.com/Ginden/map-methods/blob/master/polyfill.js and I'm
gathering opinions what would be expected final shape of Map API.

Michał Wadas
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to