JavaScriptArrayconcat
at

concatArray

every

Combines two or more strings and returns a new string.

Syntax

arr.concat(...arrays)

Example

Enter values below to update the example in real time.

const
arr1
arr2
combined
console
const arr1 = [1, 2, 3];
const arr2 = [4, 5, 6];
const combined = arr1.concat(arr2);
console.log(combined);   // [1, 2, 3, 4, 5, 6]