3 ms·
FYI, the collection returned by `querySelectorAll` has a `forEach` method, so no need for the `Array.from`
by pitaj 4y ago
FYI, the collection returned by `querySelectorAll` has a `forEach` method, so no need for the `Array.from`
- Beltalowda 4y agoThings like "I want the first/last element" is still a PITA as far as I know, so lots of people use Array.from() wrappers. For all cases I used it, the performance impact seems negligible. I don't know why querySelectorAll() doesn't just return an array.
- bastawhiz 4y agoSupporting legacy Edge requires the conversation from NodeList to Array, sadly.