Tell us what’s happening:
As far as I can tell, this is a valid solution to the problem. I looked at the requirements and the only thing that might be missing is - “All elements from the first array should be added to the second array in their original order” Is that the issue here?
Your code so far
function frankenSplice(arr1, arr2, n) {
let newArr = arr2.slice(0);
newArr.splice(n, 0, arr1)
return newArr;
}
frankenSplice([1, 2, 3], [4, 5, 6], 1);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.98 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice/