1const arr1 = [1,2,3]
2const arr2 = [4,5,6]
3const arr3 = [...arr1, ...arr2] //arr3 ==> [1,2,3,4,5,6]
1var array1 = ["Vijendra", "Singh"];
2var array2 = ["Singh", "Shakya"];
3
4console.log(array1.concat(array2));
5// output: ["Vijendra", "Singh", "Singh", "Shakya"]
1const letters = ['a', 'b', 'c'];
2const numbers = [1, 2, 3];
3
4const newArray = letters.concat(numbers);
5// newArrat is ['a', 'b', 'c', 1, 2, 3]
1let fruits = ["apples", "bananas"];
2let vegetables = ["corn", "carrots"];
3let produce = [...fruits, ...vegetables];
4//["apples","bananas","corn","carrots"]
1const a = ['to', 'code'];
2const b = ['learning', ...a, 'is', 'fun'];
3console.log(b); //> ['learning', 'to', 'code', 'is', 'fun']