MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/b2o6f2/whats_your_favorite_most_useful_javascript/eiv0fro/?context=3
r/javascript • u/Linux_is_awesome • Mar 18 '19
422 comments sorted by
View all comments
Show parent comments
11
Can also use Array.from(document...).forEach(...)
13 u/BabyLegsDeadpool Mar 19 '19 Or just do [...document.querySelectorAll(...)].forEach(...) 0 u/enHello Mar 19 '19 Or [].slice.call(document.querySelectorAll(...)).map(node => node.foo) 1 u/alinnert Mar 19 '19 Yeah, this is the pre-ES6 version. I used it a lot when I had to. It's just not as clear about what it's doing. → More replies (1)
13
Or just do [...document.querySelectorAll(...)].forEach(...)
0 u/enHello Mar 19 '19 Or [].slice.call(document.querySelectorAll(...)).map(node => node.foo) 1 u/alinnert Mar 19 '19 Yeah, this is the pre-ES6 version. I used it a lot when I had to. It's just not as clear about what it's doing. → More replies (1)
0
Or [].slice.call(document.querySelectorAll(...)).map(node => node.foo)
1 u/alinnert Mar 19 '19 Yeah, this is the pre-ES6 version. I used it a lot when I had to. It's just not as clear about what it's doing. → More replies (1)
1
Yeah, this is the pre-ES6 version. I used it a lot when I had to. It's just not as clear about what it's doing.
→ More replies (1)
11
u/the_argus Mar 19 '19
Can also use Array.from(document...).forEach(...)