I think I was enjoying my Dub Reggae music too much when I answered this one It works anyway.
I thought Iād post it out of interest and as a first post.
function frankenSplice(arr1, arr2, n) {
let newArr = [];
for(let i = 0; i < n; i++) {
newArr.push(arr2[i]);
}
for(let i = 0; i < arr1.length; i++) {
newArr.push(arr1[i]);
}
for(let i = n; i < arr2.length; i++) {
newArr.push(arr2[i]);
}
return newArr;
}
frankenSplice([1, 2, 3], [4, 5, 6], 1);
**Your browser information:**
User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
Challenge: Slice and Splice
Link to the challenge: