Tell us what’s happening:
My code is satisfying all tests but returning false on the below which i believe is an error:
All elements from the first array should be added to the second array in their original order.
Your code so far
function frankenSplice(arr1, arr2, n) {
let rarr = [];
for(var i = 0; i < arr2.length; i++) {
if(i == n) {
rarr.push(...arr1)
}
rarr.push(arr2[i])
}
return rarr;
}
frankenSplice([1, 2], ["a", "b"], 1);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36.
Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.
you can use **slice **to copy all elementes from arr1 and add in arr2 with push element, you can equal this information ( obtainted by slice) new variable and add in arr2 with push element