Slice and Splice: Why wouldn't this work?

Tell us what’s happening:

This code is not working even though it gives correct output when I use console.log() on the new array(arr3)…

Your code so far


function frankenSplice(arr1, arr2, n) {
  // It's alive. It's alive!
  let arr3=arr2.slice();
  arr3.splice(n,0,[...arr1]);
  console.log(arr3);
  return arr3;
}

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36.

This is your output.

[ 4, [ 1, 2, 3 ], 5, 6 ]

You will need to take the values out of inner the array. Try looking at the spread operator.