Tell us what’s happening:
I have currently passed all the tests. But the last test is the problem which says that the second array should remain the same after the function runs. Any help is highly appreciated
Your code so far
function frankenSplice(arr1, arr2, n) {
// It's alive. It's alive!
let arr3 = arr2.splice(0,n);
let one = arr2.slice();
let arr = arr3.concat(arr1)
let finalVals = arr.concat(one)
return finalVals;
}
console.log(frankenSplice([1, 2, 3], [4, 5], 1));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
.
Link to the challenge: