Here you can find the source of 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] = [];/*from www .ja v a 2 s. com*/ this[attr].extend(source[attr]); } else { this[attr] = source[attr]; } } }
Array.prototype.extend = function(array) { for (var i = 0; i < array.length; i++) { this.push(array[i]);
Array.prototype.extend = function (newItems) { return this.push.apply(this, newItems); };
Array.prototype.extend = function (other) { other.forEach(function(v) {this.push(v)}, this); };
Array.prototype.extend = function(other_array) { other_array.forEach(function(v) { this.push(v) }, this);
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);