Here you can find the source of each(f, callback)
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]);// w w w .j a v a2 s . c om } if (callback) callback(); } Array.prototype.asyncEach = function(f, callback, i) { i = i || 0; var l = this.length, that = this; function next() { that.asyncEach(f, callback, ++i); } i < l ? f(this[i], next) : callback(); } String.prototype.beginsWith = function(str) { return this.indexOf(str) === 0; } String.prototype.endsWith = function(str) { return this.substr(this.length - str.length) === str; } exports.hash = function(str) { var sha = crypto.createHash('sha256') sha.update(str) return sha.digest('base64') }
Array.prototype.each = function(f) { for(var i = 0; i < this.length; i++) f(this[i], i); };
Array.create = function(f, count) { var arr = []; for (var i = 0; i < count; ++i) { arr.push(f(i)); return arr; Array.prototype.each = function(f) { for (var i = 0; i < this.length; i += 1) { ...
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;
Array.prototype.each = function(f,r){ if(r===-1){ for(var i=this.length-1;i>=0;i--)f(this[i],i); }else{ for(var i=0,l=this.length;i<l;i++)f(this[i],i); };
Array.prototype.each = function(fn) { if (!fn) return false; for(let i = 0, len = this.length; i < len; i++) { if (fn(this[i], i) === false) return false;
Array.prototype.each = function(fn) { for (var i = 0; i < this.length; i++) fn(this[i]);
Array.prototype.each = function(fn) for (var i=0; i<this.length; i++) fn.apply(this[i], [i]); };