Suggestions for Set

Erik Arvidsson erik.arvidsson at gmail.com
Wed Oct 3 13:07:02 PDT 2012


On Wed, Oct 3, 2012 at 3:53 PM, Rick Waldron <waldron.rick at gmail.com> wrote:
> var d = document.createElement("div"); d.className = "foo bar baz";
> [...d.classList]
>
> ["foo", "bar", "baz"]

targetElement.classList.add(...sourceElement.classList);

:D

But then again that would work even if we didn't use the iteration protocol.

-- 
erik


More information about the es-discuss mailing list