I understand why my code is wrong: since I don´t use n++, the splice will always begin at the same location. What I don´t understand is why my code:
function frankenSplice(arr1, arr2, n) {
let arr3 = arr2.slice();
console.log(arr3)
for (let i = 0; i < arr1.length; i++) {
arr3.splice(n, 0, arr1[i]);
}
return arr3;
console.log(arr3)
}
frankenSplice([1, 2, 3], [4, 5, 6], 1);
returns this:
4,3,2,1,5,6
Why does it go through arr1 backwards?