Tell us what’s happening:
Your code so far
function frankenSplice(arr1, arr2, n) {
// It's alive. It's alive!
let copyarr1=arr1
let copyarr2=arr2
for(let i=0; i<arr1.length; i++){
copyarr2=copyarr2.splice(n,0,copyarr1[i])
n++
}
console.log(arr2)
return copyarr2;
}
frankenSplice([1, 2, 3], [4, 5, 6], 1);
Challenge: Slice and Splice
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice
why do i have to delete the " copyarr2= " in order for this to work?