I still couldn’t figure out why my code is wrong, despite getting answers as expected but failing all tests. Any help please? I have seen the guide but still I need to know where I went wrong?
Thanks in Advance,
limatgans(sgat)
My code so far
function frankenSplice(arr1=[], arr2=[], n=0) {
// It's alive. It's alive!
const resultArr = arr2.slice();
resultArr.splice(n,0, arr1);
return resultArr;
}
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 6.3; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0.