Here you can find the source of addAll(arr)
"use strict";/*from w ww . j a v a2s . c o m*/ // Ensure this is treated as a module. 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; }; } if (!String.prototype.startsWith) { String.prototype.startsWith = function (searchString) { return this.substring(0, searchString.length) === searchString; }; } if (!String.prototype.endsWith) { String.prototype.endsWith = function (searchString) { return this.indexOf(searchString, this.length - searchString.length) > -1; }; } if (!Date.prototype.isValid) { Date.prototype.isValid = function () { // An invalid date object returns NaN for getTime() and NaN is the only // object not strictly equal to itself. return this.getTime() === this.getTime(); }; } if (!Object.values) { Object.values = function (obj) { let l = []; for (const propName in obj) { l.push(obj[propName]); } return l; }; }
Array.prototype.addAll = function( list ) { for( var i=0; i<list.length; i++ ) { this.push( list[i] ); return this; };
Array.prototype.addAll = function(addingElements) { for (var elementIndex = 0; elementIndex < addingElements.length; ++elementIndex) { this.push(addingElements[elementIndex]); };
Array.prototype.addAll = function (arr) { var len = arr.length; for (var i = 0; i < len; i++) { this.push(arr[i]); };
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]; ...
Array.prototype.addAll = function(index, items){ if (items === undefined){ items = index; index = 0; for (var i=0; i<items.length; i++){ this.add(index+i, items[i]); return true; ...
Array.prototype.addAll = (items) => { this.push.apply(this, items); this.push(null); this.pop();