RE: map() annotation for iterables?

From: Boris Zbarsky [mailto:bzbarsky@mit.edu] 

> More precisely, is there any interest in recasting Array.prototype.map to be able to work on a generic iterable and then put it on the proto chain of DOM iterables?

I believe not; the algorithms for Array.prototype.* are pretty set in stone.

However, recently all iterators gained a currently-empty common prototype [%IteratorPrototype%][1]. This was done so that, in the future, we could define %IteratorPrototype%.{map, filter, etc.}. I think this will be the more fruitful way forward.

[1]: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-%iteratorprototype%-object

Received on Sunday, 5 October 2014 00:50:24 UTC