You can try and extend the Array object for browsers that do not support the foreach method on it, as suggested here by Array.forEach
One example:
if (!Array.prototype.forEach) { Array.prototype.forEach = function(fn, scope) { for(var i = 0, len = this.length; i < len; ++i) { fn.call(scope, this[i], i, this); } } }
source share