Map methods

Michał Wadas michalwadas at
Sat Jan 20 00:38:23 UTC 2018


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
<>, 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 - and I'm
gathering opinions what would be expected final shape of Map API.

Michał Wadas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list