Tell us what’s happening:
The console log seems to tell me I’m getting the correct result:
4,1,2,3,5,6
head,shoulders,claw,tentacle,knees,toes
But my code isn’t being accepted to complete the challenge.
I think I’m missing something very simple.
Your code so far
function frankenSplice(arr1, arr2, n) {
// It's alive. It's alive!
let arr1Length = arr1.length;
let arr1Copy = arr1.slice(0, arr1Length);
let arr2Length = arr2.length;
let arr2Copy = arr2.slice(0, arr2Length);
arr2Copy.splice(n, 0, arr1Copy);
console.log(arr2Copy);
return arr2Copy;
}
frankenSplice([1, 2, 3], [4, 5, 6], 1);
frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2)
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36
.
Link to the challenge: