3 ms·
Just wondering - why are you spreading the result to an array? document.querySelectorAll("#game > div > div").forEach(e => e.style.transform="rotate(0deg)")
by kidsil 4y ago
Just wondering - why are you spreading the result to an array?
document.querySelectorAll("#game > div > div").forEach(e => e.style.transform="rotate(0deg)")
Works too.
- bambax 4y agoYou're right! (But since querySelectorAll returns a NodeList and not a regular array, some methods are unavailable, so I just have this habit of making it an array. But for iteration that's indeed not needed.)