javascript concat instead of add code example
Example 1: javascript push and concat
//push() adds element in the end of array
// concat() also the same, but if the element is array, that element will probably separate elements of itself in the end of the array
Example 2: how the concat function works javascript
var arr = [1, 2, 3, 4];
var arr2 = [5, 6, 7, 8];
const both = arr.concat(arr2);
console.log(both);
//[1, 2, 3, 4, 5, 6, 7, 8]