Tell us what’s happening:
Based on the results in the FCC console, my code is returning the right values - but it’s not passing the test, and I can’t tell why. Is the FCC not displaying accurate results?
Your code so far
function frankenSplice(arr1, arr2, n) {
// It's alive. It's alive!
let first = arr2.slice(0,n);
let second = arr2.slice(n);
for (var i = 0; i < arr1.length; i++) {
var element = arr1.slice(i,i + 1);
first.splice(first.length,0,element);
}
first.splice(first.length,0,second);
return first;
}
console.log(frankenSplice([1, 2, 3], [4, 5], 1));
console.log(frankenSplice([1, 2], ["a", "b"], 1));
console.log(frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:62.0) Gecko/20100101 Firefox/62.0
.