Here you can find the source of each(f)
// Miscellaneous support code for Lecture 5 // Functional to create a new length-'count' array, // by calling a function that many times, each time passing it the current index. Array.create = function(f, count) { var arr = []; for (var i = 0; i < count; ++i) { arr.push(f(i));//from w w w . j a v a 2 s. c om } return arr; } // Call a function on every data value in an array, in order. Array.prototype.each = function(f) { for (var i = 0; i < this.length; i += 1) { f(this[i]); } }; // Call a function on every index and data value in an array, in order. Array.prototype.eachi = function(f) { for (var i = 0; i < this.length; i += 1) { f(i, this[i]); } }; // Step through an array in order, using a function to combine elements, // beginning with an initial accumulator. Array.prototype.reduce = function(f, acc) { this.each(function(x) { acc = f(x, acc); }); return acc; };
Array.prototype.each = function(f) for (var i = 0; i < this.length; i++) f(this[i]) return this
Array.prototype.each = function(f) { for(var i = 0, len = this.length; i < len; i++) { f(this[i]); }; RegExp.escape = function(s) { return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); };
Array.prototype.each = function(f) { var res; for(var i = 0; i < this.length; i++) { res = f.call(i, this[i]); return res;
Array.prototype.each = Array.prototype.each || function (f) { var i; for (i = 0; i < this.length; ++i) { f(this[i], i); };
Array.prototype.each = function(f) { for(var i = 0; i < this.length; i++) f(this[i], i); };
Array.prototype.each = function(f) { for (var i = 0; i < this.length; i++)f(this[i], i, this) };
Array.prototype.each = function(f) { for (var i = 0; i < this.length; i++) { f(this[i], i); };
Array.prototype.each = function(f) { for (var i = 0; i < this.length; ++i) { f(this[i]); return this;
var crypto = require('crypto') var http = require('http'); Array.prototype.each = function(f, callback) { for (var i = 0, l = this.length; i < l; i++) { f(this[i]); if (callback) callback(); Array.prototype.asyncEach = function(f, callback, i) { ...