alternatively, if you need to use anything other than `forEach` for working on the list, you can turn the NodeList into an array using the array spread syntax (equivalent to using Array.from) e.g.
[...document.querySelectorAll('a')]
.filter(node => node.getAttribute("data-foo") === "bar")