Tell us what’s happening:
can you tell me why my console output is in reverse order?
Your code so far
function frankenSplice(array1,array2,index){
let copyArray1 = array1.slice();
let copyArray2 = array2.slice();
for(let i =0;i<copyArray1.length;i++){
copyArray2.splice(index,0,copyArray1[i])
}
return copyArray2
};
console.log(frankenSplice([1, 2], ["a", "b"], 1));
console.log(frankenSplice([1, 2, 3], [4, 5], 1))
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
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