Nodejs Array Append Item append()

Here you can find the source of append()

Method Source Code

Array.prototype.append = function(){
    var newarray = this;
      for(var j = 0; j < arguments.length; j++){
        newarray.push(arguments[j]);
      }//from  w  ww  .j av a2 s . c  om
    return newarray;
};

Related

  1. append(a)
    Array.prototype.append = function(a) {
      this.push.apply(this, a)
    
  2. append(ar)
    Array.prototype.append = function(ar) {
      this.length += ar.length;
      for (var i = 0, len = this.length, len2 = ar.length; i < len2; i++) {
        this[len + i] = ar[i];
    };
    
  3. append(arr)
    Array.prototype.append = function (arr) {
        if (arr) {
            for (var i = 0; i < arr.length; i++) {
                this.push(arr[i]);
        return this;
    };
    
  4. append(array)
    Array.prototype.append = function(array)
      this.push.apply(this, array)