what does concat() do in javascript code example
Example 1: js combine arrays
const array1 = ["Vijendra","Singh"];
const array2 = ["Singh", "Shakya"];
const array3 = [...array1, ...array2];
Example 2: join two arrays javascript
// using push and apply to return the same array
const arr1 = ['a', 'b'];
const arr2 = ['c', 'd'];
arr1.push.apply(arr1, arr2);
console.log(arr1) // ['a', 'b', 'c', 'd']