I wonder why my code wouldn’t pass the challenge. I print the result of my splice()
and seems to be giving the result I want. Input arrays were not changed, and I have the index n
just right. Hint me please. Tia!
function frankenSplice(arr1, arr2, n) {
// It's alive. It's alive!
let newArr2 = arr2.slice()
newArr2.splice(n, 0, arr1);
console.log(newArr2)
return newArr2;
}
frankenSplice([1, 2, 3], [4, 5, 6], 1);