DEV Community

Discussion on: How do I use .forEach on DOM Elements?

Collapse
 
pmcgowan profile image
p-mcgowan

I've always used [].forEach.call(nodeList, n => n.something), however be careful if in that loop you are removing or adding nodes. Found that out the hard way.