Nodejs Array Extend extend(other)

Here you can find the source of extend(other)

Method Source Code

Array.prototype.extend = function (other) {
  //TODO: do a concat instead?
  other.forEach(function(v) {this.push(v)}, this);    
};

Related

  1. extend(arr)
    Array.prototype.extend = function(arr) {
        this.push.apply(this, arr);
        return this;
    
  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);
    };
    
  6. extend(other_array)
    Array.prototype.extend = function(other_array) {
        other_array.forEach(function(v) {
            this.push(v)
        }, this);
    
  7. extend(other_array)
    Array.prototype.extend = function(other_array) {
      if(other_array.constructor !== Array) throw other_array + ' is not an array.';
      other_array.forEach(function(v) {
        this.push(v)
      }, this);
    
  8. extend(source)
    Array.prototype.extend = function(source) {
      for (var attr in source) {
        if (Object.prototype.toString.call(source[attr]).slice(8, -1).toLowerCase() === 'array') {
          this[attr] = [];
          this[attr].extend(source[attr]);
        } else {
          this[attr] = source[attr];