The output is correct, but the following requirement is not met and it is not letting me complete the challenge:
“All elements from the first array should be added to the second array in their original order.”
**Your code so far**
function frankenSplice(arr1, arr2, n) {
let newArray = [];
for (let i=0; i < arr2.length; i++){
newArray.push(arr2[i])
if(i==n-1){
for (let x=0; x < arr1.length; x++) {
newArray.push(arr1[x])
}
}
}
arr2 = newArray
return arr2;
}
frankenSplice([1, 2, 3], [4, 5, 6], 1);
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36
.
Challenge: Slice and Splice
Link to the challenge: