Tell us what’s happening: Hey guys, I need some help with this challenge. First I know it says slice and splice and I’m not using any of that, this is my first try with the challenge so I wanted to do it like this. The problem is when I run the tests everything is fine except for the condition “All elements from the first array should be added to the second array in their original order.”. I printed the outputs and it does the right job so I can’t figure out what’s the problem. Appreciate any help
**Your code so far**
function frankenSplice(arr1, arr2, n) {
let newArr = [];
for (let i = 0; i < arr2.length; i++) {
if (i === n) {
for (let j = 0; j < arr1.length; j++) {
newArr.push(arr1[j]);
}
}
newArr.push(arr2[i]);
}
console.log(newArr);
return newArr;
}
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/89.0.4389.90 Safari/537.36
.
Challenge: Slice and Splice
Link to the challenge: