Nodejs Array Add All addAll( list )

Here you can find the source of addAll( list )

Method Source Code

Array.prototype.addAll = function( list ) {
   for( var i=0; i<list.length; i++ ) {
      this.push( list[i] );/*from  w  w w .ja va 2 s  .co m*/
   }
   return this;
};

Related

  1. addAll(addingElements)
    Array.prototype.addAll = function(addingElements) {
      for (var elementIndex = 0; elementIndex < addingElements.length; ++elementIndex) {
        this.push(addingElements[elementIndex]);
    };
    
  2. addAll(arr)
    Array.prototype.addAll = function (arr) {
        var len = arr.length;
        for (var i = 0; i < len; i++) {
            this.push(arr[i]);
    };
    
  3. addAll(arr)
    "use strict";
    Array.prototype.addAll = function (arr) {
        for (const elm of arr) {
            this.push(elm);
    };
    if (!Array.prototype.includes) {
        Array.prototype.includes = function (element) {
            return this.indexOf(element) > -1;
    ...
    
  4. addAll(index, elements)
    Array.prototype.addAll = function(index, elements) {
      if (arguments.length == 2) {
        var n = this.length, m = elements.length;
        this.length += m;
        for (var i = n - 1; i >= index; i--) {
          this[i + m] = this[i];
        for (var i = 0; i < m; i++) {
          this[i + index] = elements[i];
    ...