The Array.prototype.forEach method is part of the ECMAScript 5th Edition specification, available on all browsers , but not in IE.
I would suggest you use a simple sequential for loop, IMO is more efficient, since forEach needs a callback function, a function will start that starts closing, and you donβt have to worry about IE.
But if you want to use forEach and all the other new Array.prototype methods, such as map , filter , every , some , etc ... you can add an implementation for IE on the linked pages.
source share