0

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

Andrew Newby
  • 4,941
  • 6
  • 40
  • 81

0 Answers0