5 ms·
If you happen to be using ES6 you can utilize `Array.from` to turn node lists into arrays: let nodes = Array.from(document.querySelectorAll('.item')); node
by Scottopherson 10y ago
If you happen to be using ES6 you can utilize `Array.from` to turn node lists into arrays:
let nodes = Array.from(document.querySelectorAll('.item'));
nodes.forEach(node => console.log(node));
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- macawfish 10y agoThat's not so bad. Thanks for the tip!