Tell us what’s happening:
Hi,
this solution does not pass the test, because “The second array should remain the same after the function runs.”
But it is the same. Or it is not?
Your code so far
function frankenSplice(arr1, arr2, n) {
// It's alive. It's alive!
let end = [];
let result = [];
end = arr2.splice(n);
result = arr2.concat(arr1.concat(end));
arr2 = arr2.concat(end);
console.log(arr2);
return result;
}
frankenSplice([1, 2, 3], [4, 5, 6], 1);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice