const buttons = document.querySelectorAll(“.js-do-thing");
// There could be any number of these!
// I need to loop over them and attach a click handler.
There are SO MANY ways to go about it. Let’s go through them.
forEach is normally for arrays, and interestingly, …
The post A Bunch of Options for Looping Over querySelectorAll NodeLists appeared first on CSS-Tricks.