Concatenating Arrays in Javascript


Combine two or more arrays using the .concat() method.

Source Code

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