Combining Arrays with Spread Operator in Javascript


Merge arrays using the spread syntax.

Source Code

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