Slice and Splice Semantic problem

Tell us what’s happening:
I am getting the correct output.But my solution does not pass the test cases

Your code so far


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

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

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0.

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

You are returning a multi-dimensional array. You need to return a flat, one-dimensional array.

1 Like

Oh ! got it. The FCC output terminal doesn’t show the brackets so I was confused