const a = [1, 2, 3];
const b = [4, 5, 6];
// 1. .concat()
console.log(a.concat(b)); // [ 1, 2, 3, 4, 5, 6 ]
// 2. spread operator
console.log([...a, ...b]); // [ 1, 2, 3, 4, 5, 6 ]
Thanks for reading 💙
Follow @codedrops.tech for daily posts.
Instagram ● Twitter ● Facebook
Micro-Learning ● Web Development ● Javascript ● MERN stack ● Javascript
codedrops.tech
Top comments (0)