W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2010

[whatwg] Adding ECMAScript 5 array extras to HTMLCollection

From: Erik Arvidsson <arv@chromium.org>
Date: Mon, 26 Apr 2010 10:38:24 -0700
Message-ID: <q2j34df39071004261038t78922f30qe9e259c46f04ab92@mail.gmail.com>
> Rather that trying to make DOM collections feel like arrays, how about just
> giving them a toArray() method? ?This makes it clear that a collection is
> not an array, but clearly defines a way to obtain an array. ?Clever
> implementors might even be able to optimize common uses-cases using some
> kind of copy-on-write strategy so that toArray() doesn't involve memory
> allocation and copying.

That might be better than nothing but why should a NodeList not have a
forEach method? It is pretty clear that people want to be able to
treat Arguments and NodeList as Arrays.

Received on Monday, 26 April 2010 10:38:24 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:22 UTC