Why not NodeList#forEach :\?

Brandon Benvie brandon at brandonbenvie.com
Mon Jun 11 10:21:07 PDT 2012


Not quite impossible, you just have to get a bit creative. While certainly
not as fast as a built in implementation, the method used here is still
O(1).  https://github.com/Benvie/ES6-Harmony-Collections-Shim

>  The major use case for Maps and Sets (as far as i'm concerned) is the
> ability to use objects as keys. Having built-in implementation of these
> potentially enable O(1)-ish lookups (which is impossible to implement in
> JavaScript).
> As to Maps and {} being equivalent, that's true expect when it's not, like
> when you want to use pseudo properties like __proto__ or __noSuchMethod__
> as keys. Some folks tried to use objects as maps and got burned [1]. See
> Caja's StringMap [2] for a workaround when you only need strings as keys.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120611/9bac9870/attachment.html>


More information about the es-discuss mailing list