Tell us what’s happening:
When I log my values I get the correct results but when I run the test it doesn’t pass. What am I missing here?
Your code so far
function frankenSplice(arr1, arr2, n) {
// It's alive. It's alive!
let len = arr1.length -1;
let copy1 = arr1.slice(0);
let copy2 = arr2.slice(0);
let last = arr2.slice(n);
// console.log(last);
copy2.splice(n, len, copy1);
copy2.push(last);
// console.log(copy2);
return copy2;
}
frankenSplice([1, 2, 3], [4, 5, 6], 1);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice