Extra functions on Arrays, Maps, etc..

Rick Waldron waldron.rick at gmail.com
Sat Apr 7 17:37:14 PDT 2012

On Sat, Apr 7, 2012 at 8:31 PM, Erik Arvidsson <erik.arvidsson at gmail.com>wrote:

> On Sat, Apr 7, 2012 at 17:28, Rick Waldron <waldron.rick at gmail.com> wrote:
> > As in, its [[Class]] is "Array" and Array.isArray( nodes ) would
> evaluate to
> > true?
> No, it means that Object.getPrototypeOf(NodeList.prototype) ===
> Array.prototype.

Yes, this part was clear in the links you sent. The question I had was
about two things that were not addressed in the links (that I could see,
please correct if I missed them)

There will be much confusion on the web if Array.isArray(nodes) returns
false, while nodes.push( node ), nodes.slice( 0, 2 ) "just work",
especially during periods of transition from DOMx to DOM4.


> Fortunately all the Array.prototype methods are generic so it all just
> works.
> --
> erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120407/6fa1f70c/attachment-0001.html>

More information about the es-discuss mailing list