forEach not working in several older browsers that should have support

Viewed 14

I'm trying to figure out why Safari 9 throws up an error with the below code:

const features_blocks = document.querySelectorAll('#feature-blocks .block');
features_blocks.forEach(f => {
// do something here
});

The error is:

Uncaught TypeError: features_blocks.forEach is not a function

I also see it on some older firefox versions, and Chrome 49 (just the 3 I noticed in our error tracker). Is there something I'm doing wrong? CanIUse seems to suggest forEach is supported in all these versions:

https://caniuse.com/?search=foreach

0 Answers
Related