Andy Wingo (2014-11-28T11:51:34.000Z)
d at domenic.me (2014-12-05T19:15:26.629Z)
On Thu 20 Nov 2014 01:49, Dmitry Soshnikov <dmitry.soshnikov at gmail.com> writes: > 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: > > ``` > map > .entries() // returns an iterator > .map((v, k, m) => { ... }) > .filter((v, k, m) => { ... }) > .collect(); // returns a new map after all transforms > ``` Is there a nice way to do this for the default iterator? This is pretty terrible: ```js [1,2,3][Symbol.iterator]().map(x=>x+1) ``` Also, I thought that map, filter, and such were to be on the Iterator.prototype. That precludes multi-arg map functions, doesn't it?