I’ve looked through past topics with issues for this challenge and none seem to be quite the same problem as I’m having. In the console my code always does what the challenge specifies, which is:
Use the array methods
slice
andsplice
to copy each element of the first array into the second array, in order.Begin inserting elements at index
n
of the second array.Return the resulting array.
I’m kind of stumped. Below is my code:
function frankenSplice(arr1, arr2, n) {
let x = arr2
x.splice(n, 0, arr1)
console.log(x)
return x;
}
frankenSplice([1, 2, 3], [4, 5], 1));
Any help as to what I’m missing to understand this would be appreciated. I’ve heard others suggest that the checker is broken but my hunch is that this is not the case.
Thanks in advance!