Here you can find the source of forEach(a)
"use strict"/*from w w w . j a va 2 s. co m*/ Array.prototype.forEach = function(a) { for (let i = 0; i < this.length; i++) a(this[i], i, this) }
===
Array.prototype.forEach = Array.prototype.forEach || _forEach Array.prototype.every = Array.prototype.every || _every Array.prototype.indexOf = Array.prototype.indexOf || function(member) { for(var idx = 0; idx < this.length; ++idx) { if(this[idx] === member) { return idx return -1 ...
Array.prototype.forEach = Array.prototype.forEach || function(action, index) { for (var i=0,l=this.length; i<l; i++) { action(this[i], index); };
Array.prototype.forEach = function(callback){ let arr = this; for (var i = 0; i < arr.length; i++) { callback(arr[i], i, arr);
Array.prototype.forEach = function(callback){ var a = 0, len = this.length; while(a < len){ callback(this[a], a++, this); };
Array.prototype.forEach = Array.prototype.forEach || function (callback) { var self = this; for (var i = 0; i < self.length; i++) { var item = self[i]; callback(item, i, self);