Hi,
I’ve tested the following code, & it produces the correct results. However, the freeCodeCamp program tells me I’m not delivering the correct results. Is this because I’m not supposed to use an array as the 3rd argument in splice?
Thank you for your time,
Michael
function frankenSplice(arr1, arr2, n) {
let arrResult = arr2.slice()
arrResult.splice(n, 0, arr1);
console.log(arrResult);
return arrResult;
}
frankenSplice([1, 2, 3], [4, 5, 6], 1);
frankenSplice([1, 2, 3], [4, 5], 1);
frankenSplice([1, 2], [“a”, “b”], 1)
frankenSplice([“claw”, “tentacle”], [“head”, “shoulders”, “knees”, “toes”], 2)
**Your browser information:**
User Agent is: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15`.
**Link to the challenge:**
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice/