My question is about the output of this program: in the FCC (freecodecamp) console I see 4,3,2,1,5, whereas in the node console I see [ 4, 3, 2, 1, 5 ](same with the other arrays).
I also tried this at the line number 8: let result = array2Copy.map(i => i.toString());
function frankenSplice(arr1, arr2, n) {
let array2Copy = arr2.slice(0);
for (let i = 0; i < arr1.length; i++){
array2Copy.splice(n, 0, arr1[i]);
}
let result = array2Copy;
return array2Copy;
}
console.log(frankenSplice([1, 2, 3], [4, 5], 1));-->4,3,2,1,5
console.log(frankenSplice([1, 2], ["a", "b"], 1));-->a,2,1,b
According with the FCC console, I need the following output: [4, 1, 2, 3, 5]