Tell us what’s happening:
The code below technically returns the proper arrays, but it does not pass the first 4 tests. Is this because of the object references or…?
Your code so far
function frankenSplice(arr1, arr2, n) {
const begin = arr2.slice(0,n);
const end = arr2.slice(n,arr2.length);
const newArr = [];
newArr.push(begin,arr1,end);
return newArr;
}
console.log(frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2));
//frankenSplice([1, 2, 3], [4, 5, 6], 1)
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice