Tell us what’s happening:
As far as I can tell, my code correctly returns an array, with the elements in the correct order, and inserted at the correct index. But I’m unable to pass the tests. Could someone have a look at my code and hint at where I’ve gone wrong?
Your code so far
function frankenSplice(arr1, arr2, n) {
let newArray = arr2.slice();
newArray.splice(n, 0, arr1);
return newArray;
}
frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2)
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36
.
Link to the challenge: