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?
+3
A:
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.
PhiLho
2008-10-01 09:04:35
A:
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.
Slace
2008-10-01 09:26:02
Does this change the Array implementation in IE? last time I checked, extending the Array object in IE failed.
scunliffe
2008-10-03 18:21:35
I'd think so, I hardly think the MS AJAX team would make IE break :P
Slace
2008-10-03 21:47:12
+1
A:
Since IE doesn't support it (not even v8), I use jQuery.each() -- http://docs.jquery.com/Utilities/jQuery.each
Joubert Nel
2009-11-30 23:42:30