DEV Community

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

Collapse
 
alainvanhout profile image
Alain Van Hout

Although it's a very good point that you can use a for-loop in this case, your own solution can be simplified to [].forEach.call, which would also work in case you'd need other array operations such as map, filter or reduce.