RE: Elements array and query/queryAll methods

From: Dean Edwards <dean.edwards@gmail.com>

> The question I have about this proposal is how do we handle people adding non-elements to the array?

The spec covers this. They are ignored.

> Also, this is much harder to polyfill than the previous find(All) proposal.The polyfill you linked to requires ES6

Only in the sense that subclassing arrays requires ES6 subclassing semantics (@@create, fixes to the Array.prototype.map algorithm, etc.). The polyfill linked to mostly uses ES6 for syntactic convenience.

> and I'm not convinced it works anyway, won't it potentially allow duplicates in the resulting Array?

Why would that be a problem? JavaScript developers have duplicates in their arrays all the time.

Received on Tuesday, 8 April 2014 17:44:06 UTC