Tell us what’s happening:
I have tried all of the test cases with console.log() and they seem to return the correct thing, though none of the test cases are passing. I think there is something simple I don’t understand about the freeCodeCamp IDE. Someone tell me why none of my test cases are passing please.
Your code so far
function frankenSplice(arr1, arr2, index) {
newArr = new Array(arr1.length + arr2.length);
for (let i = 0; i < newArr.length; i++) {
if (i < index) {
newArr[i] = arr2[i];
}
else if (i > index + arr1.length - 1) {
newArr[i] = arr2[i - arr1.length];
}
else {
newArr[i] = arr1[i-index];
}
}
return newArr;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36 Edg/139.0.0.0
Challenge Information:
Implement the Slice and Splice Algorithm - Implement the Slice and Splice Algorithm
https://www.freecodecamp.org/learn/full-stack-developer/lab-slice-and-splice/implement-the-slice-and-splice-algorithm