function frankenSplice(arr1, arr2, n) {
let a = arr2.slice(0);
let start = a[n];
a.splice(n,1, …arr1.slice(0), start);
return a;
}
console.log(frankenSplice([1, 2, 3], [4, 5], 1));
Whenever I run this i get the error:
All elements from the first array should be added to the second array in their original order.
Output value is same as desired but cant figure out the wrong with order.