Suggestions for Set

Rick Waldron waldron.rick at gmail.com
Wed Oct 3 12:53:26 PDT 2012


On Wed, Oct 3, 2012 at 3:47 PM, Jason Orendorff
<jason.orendorff at gmail.com>wrote:

> On Wed, Oct 3, 2012 at 1:57 PM, Brendan Eich <brendan at mozilla.com> wrote:
> > On that point, does NodeList have an iterator in Firefox now? That's an
> > obvious Array.from argument type.
>
> Yep!
>
>     > document.body.querySelectorAll("p").iterator()
>     [object Iterator]
>
>     > [...document.body.querySelectorAll("p")].length
>     1
>
> Huh. Only one? That's weird, I thought gmail would have lots of <p>
> elements.
>
>     > [...document.body.querySelectorAll("div")].length
>     1723
>
> There we go.
>

Looks like DOMTokenList as well...

var d = document.createElement("div"); d.className = "foo bar baz";
[...d.classList]

["foo", "bar", "baz"]

:)


This makes a really good case for aligning Array.from, for-of and spread

Rick



> -j
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121003/1eeec9c0/attachment.html>


More information about the es-discuss mailing list