how to concatenate two string array in javascript code example
Example 1: javascript concat two arrays
//ES6
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']