Javascript Array forEach(iterator)
Array.prototype.forEach = function(iterator) { for (var i = 0, len = this.length; i < len; i++) { iterator(this[i], i);/*from ww w . j a va 2s . com*/ } };