Favorites

JavaScript Array.prototype.concat() Method

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Array.prototype.concat()
JavaScript Array Instance methodThis method is supported by all modern browsers.
Updated 28th November 2026

The concat() method joins arrays and values into a new array, leaving the originals unchanged.

Description

The concat() method merges the array with other arrays or values and returns the result as a new array. The original arrays aren't changed. Array arguments are spread one level deep, while nested arrays inside them are kept as they are.

The spread syntax, [...a, ...b], does the same job and is often easier to read. Note that the copy is shallow: objects inside the arrays are shared, not cloned.

Because it returns a new array, concat() is handy where data mustn't be mutated, such as state in UI frameworks. Objects that aren't arrays are added as a single element, even array-like ones such as a NodeList; convert those with Array.from() first if you want their items.

Syntax

array.concat(value1, value2, ...)

Parameters

  • value1, value2, ...Arrays or values to add to the end. Arrays are flattened one level; other values are added as they are.

Return Value

A new array containing the elements of the original followed by the new values.

Example

const a = [1, 2];
const b = [3, 4];
console.log(a.concat(b));
console.log(a.concat(5, [6, [7]]));
console.log([...a, ...b]);
console.log(a);   // unchanged

Browser Support

The following information will show you the current browser support for the Array.prototype.concat() method. Hover over a browser icon to see the version that first introduced support for this method.

This method is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee