myArray.concat( [ item1 ], [ item2 ], [ ... ] ) in ECMAScript 262

Concatenates one or more items or arrays onto the current array.


item1 Object [optional] The first item to add.
item2 Object [optional] The second item to add.
... Object [optional] etc.
Return Type


This method takes an arbitrary number of parameters, and concatenates the values onto the calling array object. As with most ECMAScript object methods, the calling object is not modified; instead, the result of the operation is returned as a new array. If no arguments are supplied, a duplicate of the current array is returned. (Not a pointer to the same array.) If any argument is itself an array, then the contents of that array are added, not the array itself. In other words:
var hisColors = [ 'blue', 'red' ];
var herColors = [ 'purple' , 'pink', 'yellow' ];
var hisAndHers = hisColors.concat(herColors);
    //hisColors is still ['blue','red'];
    //hisAndHers is ['blue','red','purple','pink','yellow']
    //it is NOT ['blue','red',['purple','pink','yellow']]

var someColors = hisColors.concat( 'orange' , 'green' , ['black', 'white'] );
someColors.toString(); //blue,red,orange,green,black,white