Oh, hey. Looks like forEach has been added to the WebIDL spec for NodeList and other DOM iterables. Ain't that fancy. Time to go revise a whole bunch of code!
Or, if you're in Chrome, use $$(), which is a console method that returns the result of querySelectorAll() as an array instead of a nodelist! Very succinct and handy when futzing with the DOM in DevTools.
It does not. The Chrome command line API comes with $, which is not available from browser code. Also, the CLA version of $ is equivalent to document.querySelector, not querySelectorAll.
2
u/[deleted] Mar 19 '19
NodeLists do not have theArrayfunctions on their prototype.[].forEach.call(document.querySelectorAll('.whateverClassTheCheckboxHas'), cb => cb.click());