controlling sparseness of Array iterators (was: Array#filter without callback function)

Allen Wirfs-Brock allen at wirfs-brock.com
Mon Nov 12 15:10:49 PST 2012


On Nov 12, 2012, at 3:03 PM, Erik Arvidsson wrote:

> On Mon, Nov 12, 2012 at 5:39 PM, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:
> So the question on the floor:  is there any interest in having this variation of array iteration in ES6?
> 
> I would prefer not. Sparse arrays are really rare and for the few cases these are used I expect the author to be willing to pay a little bit extra instead of everyone else having to pay for these rare cases.

What's the "everyone else" cost?  If you don't request sparseness you get a dense iteration and since this is determined when the iterator is created an implementation can select a minimum cost algorithm. 

Allen


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121112/c41422ad/attachment.html>


More information about the es-discuss mailing list