Created
June 17, 2018 20:36
-
-
Save Kaeyz/042adf115546eef19a4e0a3611bec4ee to your computer and use it in GitHub Desktop.
Freecodecamp challenge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function frankenSplice(arr1, arr2, n) { | |
let arr3 = []; | |
arr2.splice(n, 0, arr1) | |
arr2 | |
arr3 = arr2.join(","); | |
console.log(arr3.length); | |
} | |
frankenSplice([1, 2, 3], [4, 5, 6], 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I used slice to create a new non-related copy of arr2, then worked the splice on arr3.