NodeList.prototype.__proto__ = Array.prototype lets you do document.querySelectorAll(…).forEach(…) etc (IE11 supports __proto__ too)
-
-
@mathias I'd like the DOM to do this by default really, and that (or similar) to be the polyfill. Is there a downside I've missed? -
@jaffathecake@mathias am I missing why forEach on a NodeList is a bad thing? - 3 more replies
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.