What's wrong with this method?

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

function frankenSplice(arr1, arr2, n) {
let a = arr2.slice();
return a.splice(n, 0, ...arr1);
}

console.log(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/98.0.4758.102 Safari/537.36

Challenge: Slice and Splice

Link to the challenge:

Have a look at the return value for splice when no elements are removed.

1 Like