W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2011

Re: toArray() method for array-like DOM list objects

From: Marat Tanalin | tanalin.com <mtanalin@yandex.ru>
Date: Thu, 22 Dec 2011 22:51:21 +0400
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: www-dom@w3.org
Message-Id: <88061324579881@web117.yandex.ru>
At least since it uses some function with dummy argument to do something that slice function is not intended to, and that purpose is no-so-clear from the script code. There was also information from jQuery developers (cannot find a link unfortunately) that this method works even slower that manual iterating item-by-item.

toArray() would be much more clear, straightforward, and fast way to achieve exactly converting DOM list to Array.


22.12.2011, 22:35, "Boris Zbarsky" <bzbarsky@MIT.EDU>:
> On 12/22/11 1:19 PM, Marat Tanalin | tanalin.com wrote:
>
>> šFirst way seems to be a hack
>
> Why? šIt's the standard way to convert an array-like object to an actual
> Array in EcmaScript....
>
> -Boris
Received on Thursday, 22 December 2011 18:52:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:14:08 GMT