Using Array.concat() to Merge Arrays in Javascript


Merge two or more arrays.

Source Code

let arr1 = [1, 2, 3];
let arr2 = [4, 5, 6];
let mergedArr = arr1.concat(arr2);
console.log(mergedArr); // [1, 2, 3, 4, 5, 6]
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments