Map: filter/map and more

Dmitry Soshnikov dmitry.soshnikov at
Wed Nov 19 16:49:41 PST 2014

(For the history of this thread to refer to it later)

At the meeting it was decided not to go with `map` and `filter` sitting on
`Map.prototype`, but instead to use iterators in the way like:

  .entries() // returns an iterator
  .map((v, k, m) => { ... })
  .filter((v, k, m) => { ... })
  .collect(); // returns a new map after all transforms

The `forEach` method is the only which will still exist on `Map.prototype`,
and the committee agreed it's fine.

At the same time, the `forEach` can be called on iterator as well:



On Mon, Nov 17, 2014 at 1:09 PM, Brendan Eich <brendan at> wrote:

> Dmitry Soshnikov wrote:
>> Is this something what is ready for discussion on a meeting (in
>> particular, tomorrow's meeting)?
> You put something on the agenda, cool.
> /be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list