From http://www.w3schools.com (Copyright Refsnes Data)
JavaScript Array Object
The concat() method is used to join two or more arrays.
This method does not change the existing arrays, it only returns a copy of the joined arrays.
| arrayObject.concat(arrayX,arrayX,......,arrayX) |
| Parameter | Description |
|---|---|
| arrayX | Required. One or more array objects to be joined to an array |
Example 1Here we create two arrays and show them as one using concat():
The output of the code above will be:
Try it yourself » |
Example 2Here we create three arrays and show them as one using concat():
The output of the code above will be:
Try it yourself » |
JavaScript Array Object
From http://www.w3schools.com (Copyright Refsnes Data)