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

Andrea Giammarchi andrea.giammarchi at
Mon Nov 12 16:06:23 PST 2012

this is really easy to fix via code but I would rather propose an
Array#compact() or Array#dense() method rather than changing everything
else (included shims/polyfills)

I really don't remember when it happened last time that I had to deal with
such kind of Arrays ... and this made already every polyfill slower with
the `index in array` check per each element in the loop: edge case, a bit
too much, imho, not worth it to include now in every method otherwise we
gonna have all native Array wrappers meanwhile that browsers will catch up,
I can bet that

On Mon, Nov 12, 2012 at 3:24 PM, Jason Orendorff
<jason.orendorff at>wrote:

> On Mon, Nov 12, 2012 at 4:39 PM, Allen Wirfs-Brock <allen at>wrote:
>> So the question on the floor:  is there any interest in having this
>> variation of array iteration in ES6?
> No. Why complicate the API with a feature just for people who use sparse
> arrays on purpose? From what we hear, there are almost no such people.
> -j
> _______________________________________________
> es-discuss mailing list
> es-discuss at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list