Nodejs Array Extend extend(array)

Here you can find the source of extend(array)

Method Source Code

// takes an array and add it's eliments to the end of this array
// a = [1, 2, 3]/*from   w  ww  .j av a2s .c om*/
// b = [4, 5, 6, 7]
// a.extend(b)
// a => [1, 2, 3, 4, 5, 6, 7]
Array.prototype.extend = function(array)
{
    this.push.apply(this, array)
}

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(arr)
    Array.prototype.extend = function(arr) {
        this.push.apply(this, arr);
        return this;
    
  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);
    };
    
  6. extend(other)
    Array.prototype.extend = function (other) {
      other.forEach(function(v) {this.push(v)}, this);    
    };