There are two arrays, for example:
arr1 = ["a", "b"];
arr2 = ["c", "d"];
I want to add the elements of the second one to the first one, after this operation arr1
should look like ["a", "b", "c", "d"]
. Doesn't matter what happens with arr2
.
I tried the classic method: arr1.push(arr2)
and the result looks like: ["a", "b", Array(2)]
.