Array.prototype.forEach alternative implementation parameters
问题 When working on my latest web application and needing to use the Array.forEach function, I constantly found the following code used to add support to older browsers that do not have the function built in. /** * Copyright (c) Mozilla Foundation http://www.mozilla.org/ * This code is available under the terms of the MIT License */ if (!Array.prototype.forEach) { Array.prototype.forEach = function(fun /*, thisp*/) { var len = this.length >>> 0; if (typeof fun != "function") { throw new TypeError