Chrome, Safari and Opera now support querySelectorAll().forEach() 
-
-
Different programming patterns. I usually filter() first then forEach() on the remaining elements.
-
In other words, in the scenario you describe iterable DOM NodeLists don’t really help you
- 1 more reply
New conversation -
-
-
when would a break be appropriate or desirable? Is the returned entity dynamic?
-
`qSA` returns a non-live `NodeList`. `break` is useful if you can stop processing the elements mid-loop. +
@bdc - 2 more replies
New conversation -
-
-
That doesn't work in Firefox for me, but with `let` it does. Is that a bug?
-
Yup, block scoping bug in FF as far as I know.
End of conversation
New conversation -
-
-
so does forEach `document.querySelectorAll('*').forEach((s,u,p) => {if(e.classList.contains('yo'))p.length = 0;});`



-
That's the scariest thing I saw today.
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.