Tell us what’s happening:
Can someone help me understand why this solution does not work for this challenge? I pass all of the test inputs into it and they come back as they should, however, the webpage keeps telling me outPut is undefined.
Thank you so much!
Your code so far
function frankenSplice(arr1, arr2, n) {
// It's alive. It's alive!
outPut = arr2;
outPut.splice(n,0,...arr1);
return outPut;
}
frankenSplice([1, 2, 3], [4, 5, 6], 1);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice