From: Tab Atkins Jr. [mailto:jackalm...@gmail.com]
> Interesting idea, but I'm not sure how it's supposed to work in practice. Doesn't answer all of your questions, and is probably half-assed in various ways, but here is some stuff that we came up with in some live-coding during the meeting: ```js Map.prototype.entries = function () { return new MapIterator({ collectAs: this.constructor[Symbol.species] }); }; class MapIterator extends Iterator { constructor({ collectAs }) { super(); this[Symbol.collectAs] = collectAs; } } Iterator.prototype.collect = function () { return this[Symbol.collectAs].from(...); }; myMap.entries() // proposal: you can remove .entries() .filter(([k, v]) => k % 2 === 0) .map(([k, v]) => [k * 2, v]) .forEach(...); // or .reduce(...) also forces // or for-of // or .collectAs(Array) // or .collect(), which uses [Symbol.collectAs] as a default ``` _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss