JavaScript Array concat()
Example
Join two arrays:
const hege = ["Cecilie", "Lone"];
const stale = ["Emil", "Tobias", "Linus"];
const children = hege.concat(stale);
More "Try it Yourself" examples below.
Definition and Usage
The concat() method concatenates (joins) two or more arrays.
The concat() method does not change the existing arrays,
but returns a new array, containing the values of the joined arrays.
Browser Support
concat() is fully supported in all browsers:
| Chrome | IE | Edge | Firefox | Safari | Opera |
| Yes | Yes | Yes | Yes | Yes | Yes |
Syntax
array1.concat(array2, array3, ..., arrayX)
Parameter Values
| Parameter | Description |
|---|---|
| array2, array3, ..., arrayX | Required. The arrays to be joined |
Technical Details
| Return Value: | An Array object, representing the joined array |
|---|---|
| JavaScript Version: | ECMAScript 1 |
More Examples
Example
Join three arrays:
const hege = ["Cecilie", "Lone"];
const stale = ["Emil", "Tobias", "Linus"];
const kai = ["Robin"];
const children = hege.concat(stale, kai);
Try it Yourself »

