[whatwg/dom] Add forEach to HTMLCollection interface (#757)

With `NodeList` now implementing `iterable<Node>`, I went looking to see why we don't get it on a collection. I couldn't find a reason - so while I'm assuming it's already been discussed, I'm opening this to suggest it on the off chance it hasn't.

There's a Chrome bug about it here, and the idea wasn't immediately dismissed: https://bugs.chromium.org/p/chromium/issues/detail?id=435862

The use case for this is easily iterating over the results of something like `getElementsByClassName`. I saw someone using array spread as a hacky way to do this, and this would be a much nicer solution.

Spec: https://dom.spec.whatwg.org/#interface-htmlcollection

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/757

Received on Saturday, 4 May 2019 22:39:35 UTC