Nodejs Utililty Methods Array ForEach

List of utility methods to do Array ForEach

Description

The list of methods to do Array ForEach are organized into topic(s).

Method

forEach(cb)
Array.prototype.forEach = function(cb){
  for(var k in this) cb(this[k]);
};
forEach(cb)
Array.prototype.forEach = function(cb) {
    for (var i = 0; i < this.length; i++) {
        cb(this[i]);
};
forEach(cb)
'use strict';
Array.prototype.forEach = function(cb) {
  for(let i = 0 ; i < this.length ; i++) {
    cb(this[i]);
};
forEach(fn)
Array.prototype.forEach  = function(fn) {
  for (var i = 0; i < this.length; i++) fn(this[i]);
forEach(fn)
Array.prototype.forEach=function(fn){
    var arr=this;
    var length=this.length;
    for(var i=0;i<length;i++){
        fn(arr[i],i,arr);
forEach(fn)
Array.prototype.forEach = function(fn)
    for (var i=0;i<this.length;i++)
        fn(this[i]);
forEach(fn, context)
Array.prototype.forEach = function(fn, context) {
  if (typeof fn != "function") {
    throw new TypeError(fn + " is not a function");
  if (typeof context === 'undefined') {
    context = this;
  for (var i = 0, l = this.length; i < l; ++i) {
    fn.call(context, this[i], i, this);
...
forEach(fun /*, thisp */)
Array.prototype.forEach = Array.prototype.forEach || function(fun ) {
  "use strict";
  if (this === void 0 || this === null) throw new TypeError();
  var t = Object(this);
  var len = t.length >>> 0;
  if (typeof fun !== "function") throw new TypeError();
  var thisp = arguments[1];
  for (var i = 0; i < len; i++) {
    if (i in t) fun.call(thisp, t[i], i, t);
...
forEach(fun /*, thisp*/)
Array.prototype.forEach = function(fun )
    var len = this.length;
    if (typeof fun != "function")
      throw new TypeError();
    var thisp = arguments[1];
    for (var i = 0; i < len; i++)
      if (i in this)
...
forEach(fun /*, thisp*/)
Array.prototype.forEach = Array.prototype.forEach || function(fun ) {
    var len = this.length >>> 0;
    if (typeof fun != "function") {
        throw new TypeError();
    var thisp = arguments[1];
    for (var i = 0; i < len; i++) {
        if (i in this) {
            fun.call(thisp, this[i], i, this);
...