Slice and Splice - why is this incorrect

Slice and Splice - why is this incorrect
0

#1

Tell us what’s happening:
My tests are passing, but if I log the output of the functions it seems like everything is exactly as the tests want:

Your code so far


function frankenSplice(arr1, arr2, n) {
  // It's alive. It's alive!


let localArr = arr2.slice();

localArr.splice(n, 0, ...arr1);

return localArr;
}

frankenSplice([1, 2, 3], [4, 5], 1);

frankenSplice([1, 2], ["a", "b",], 1);

frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2);


Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.2 Safari/605.1.15.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice/


#2

Nothing is wrong with your code. You may need to just refresh the page and try running the tests again. Also make sure you are not using Safari or Edge, because these browsers do not have the latest features which browsers like Chrome and Firefox have, which work well with the curriculum.


#3

Thanks. I was using Safari :expressionless: works!