Concatenate Two Arrays
ARRAY
Adventure Scenario
Given two arrays array1
and array2
, return a new array containing all the elements from both arrays, with the elements of array1
followed by those of array2
.
Examples
concatenateArrays([1, 2, 3], [4, 5, 6]) // [1, 2, 3, 4, 5, 6] concatenateArrays([7, 8, 9], []) // [7, 8, 9] concatenateArrays([], [10, 11, 12]) // [10, 11, 12] concatenateArrays([], []) // []
Loading...