Hacker News new | ask | show | jobs
by esprehn 3085 days ago
The modern DOM API has forEach on NodeList so you can skip the Array.from.

  document.querySelectorAll('.my-component div').forEach(node => node.style.background = 'yellow');
https://developer.mozilla.org/en-US/docs/Web/API/NodeList/fo...