Which browsers other than Firefox support Array.forEach()? Mozilla say it's an extension to the standard and I realise it's trivial to add to the array prototype, I'm just wondering what other browsers support it?
Which browsers other than Firefox support Array.forEach()? Mozilla say it's an extension to the standard and I realise it's trivial to add to the array prototype, I'm just wondering what other browsers support it?
The JavaScript article of Wikipedia lists the JS versions by browser. forEach is part of JavaScript 1.6. So it is supported indeed by most browsers, except Opera 9.02 (which I just tested). Opera 9.5 (which I just installed!) supports it, along with indexOf for Array.
Surprisingly, it is not official. I don't see its support in the page ECMAScript support in Opera 9.5. Perhaps it is an overlook or perhaps only a partial support they don't want to advertise.
The Microsoft AJAX client library adds this to the Array prototype so if you have that client library in your site then you'll have it for sure.
I have checked on caniuse.com and it looks like all browsers support foreach except Opera Mini which has support info as ?Support unknow. If you're interested you can use this link to check the browser support for any features. https://caniuse.com/?search=foreach