Nodejs Array Extend extend(arr)

Here you can find the source of extend(arr)

Method Source Code

// returns a new array with the elements of `arr` appended to the array
Array.prototype.extend = function(arr) {
    this.push.apply(this, arr);//from w  w w. j av  a2 s . c  o  m
    return this;
}

Related

  1. extend()
    Array.prototype.extend = function()
      var oCurrentObj = {};
      for(var i = 0; i < this.length; i++)
        oCurrentObj = this[i].extend(oCurrentObj);
      return oCurrentObj;
    
  2. extend(array)
    Array.prototype.extend = function(array)
        this.push.apply(this, array)
    
  3. extend(array)
    Array.prototype.extend = function(array){
      for (var j = array.length-1; j >= 0; j--) this.unshift(array[j]);
      return this;
    };
    
  4. extend(array)
    Array.prototype.extend = function(array) {
      for (var i = 0; i < array.length; i++) {
        this.push(array[i]);
    
  5. extend(newItems)
    Array.prototype.extend = function (newItems) {
        return this.push.apply(this, newItems);
    };