Tell us what’s happening:
The console logs all match the expected outputs so I am a little confused. Maybe I’m not thinking broad enough?
Your code so far
function frankenSplice(arr1, arr2, n) {
// It's alive. It's alive!
let arr3 = arr2.slice(0,arr2.length);
arr3.splice(n, 0, [...arr1]);
return arr3;
}
frankenSplice([1, 2, 3], [4, 5, 6], 1);
console.log(frankenSplice([1, 2], ["a", "b"], 1));
// ["a", 1, 2, "b"]
console.log(frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2));
//["head", "shoulders", "claw", "tentacle", "knees", "toes"]
console.log(frankenSplice([1, 2, 3], [4, 5], 1));
//[4, 1, 2, 3, 5]
Your browser information:
User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice/