Sorry to disturb everyone but, I just finished writing a code for one of the “Basic Javascript Algorithm Scripting” challenge. The console returns the required answer but I can’t seem to go to next challenge with this code I’ve written.
I also want to say that "This section of Javascript - “Basic Javascript Algorithm Scripting” is tough. lol. I’ve been wanting to rush it like I was doing others, but so far I’ve checked the hint page twice for two challenges and the ones I solved took me so much time to code.
function frankenSplice(arr1, arr2, n) {
// It's alive. It's alive!
let arr3 = arr2.slice();
arr3.splice(n, 0, arr1.slice());
return arr3;
}
console.log(frankenSplice([1, 2, 3], [4, 5, 6], 1));
console.log(frankenSplice([1, 2], ["a", "b"], 1));
console.log(frankenSplice(["claw", "tentacle"], ['head', 'shoulders', 'knees', 'toes'], 2));
Here’s an image of my solution
Your browser information:
Link to the challenge: