1function frankenSplice(arr1, arr2, n) {
2 // Create a copy of arr2.
3 let combinedArrays = arr2.slice()
4 // [4, 5, 6]
5
6 // Insert all the elements of arr1 into arr2 beginning
7 // at the index specified by n. We're using the spread
8 // operator "..." to insert each individual element of
9 // arr1 instead of the whole array.
10 combinedArrays.splice(n, 0, ...arr1)
11 // (1, 0, ...[1, 2, 3])
12 // [4, 1, 2, 3, 5, 6]
13
14 // Return the combined arrays.
15 return combinedArrays
16}
17
18frankenSplice([1, 2, 3], [4, 5, 6], 1);