loading...
Cover image for [SOLVED] How To Merge Arrays Using Spread Operator?

[SOLVED] How To Merge Arrays Using Spread Operator?

islam profile image Islam Sayed ・1 min read

Spread Operator is of a great use in case of dealing with arrays and objects. Here how to merge two arrays using it.

const arr1 = [1, 2];
const arr2 = [3, 4];

const arr3 = [...arr1, ...arr2]; // [1, 2, 3, 4]

Discussion

pic
Editor guide