Created
October 7, 2016 14:02
-
-
Save sAbakumoff/e2f78931adcccf0585f196e8c5862261 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!Array.prototype.forEach) { | |
Array.prototype.forEach = function(callback, thisArg) { | |
if (this === null) { | |
throw new TypeError('Array.prototype.forEach called on null or undefined'); | |
} | |
if (typeof callback !== "function") { | |
throw new TypeError(callback + ' is not a function'); | |
} | |
var len = this.length || 0; | |
for(var i=0; i<len;i++){ | |
callback.call(thisArg, this[i], i, this); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment