Node.js examples for Array:Array Operation
Combines two Arrays
/**//from w w w . j a v a 2s .c om * combines two Arrays * * @param {Array} arr * Array object * * @return {Array} new merged Array object * */ Array.prototype.merge = function(arr, bShuffle) { var type = Object.prototype.toString.call(this).split(/\W/)[2]; if (type === 'Array') { var output = this.concat(arr); return output; } };