Join two arrays:
The values of the children array will be:
More "Try it Yourself" examples below.
The concat() method is used to join two or more arrays.
This method does not change the existing arrays, but returns a new array, containing the values of the joined arrays.
The numbers in the table specify the first browser version that fully supports the method.
Method | |||||
---|---|---|---|---|---|
concat() | 1.0 | 5.5 | 1.0 | Yes | Yes |
Parameter | Description |
---|---|
array2, array3, ..., arrayX | Required. The arrays to be joined |
Return Value: | An Array object, representing the joined array |
---|---|
JavaScript Version: | 1.2 |
Join three arrays:
The values of the children array will be: