Skip to content

Instantly share code, notes, and snippets.

@Kaeyz
Created June 17, 2018 20:36
Show Gist options
  • Save Kaeyz/042adf115546eef19a4e0a3611bec4ee to your computer and use it in GitHub Desktop.
Save Kaeyz/042adf115546eef19a4e0a3611bec4ee to your computer and use it in GitHub Desktop.
Freecodecamp challenge
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);
@uzorjchibuzor
Copy link

I used slice to create a new non-related copy of arr2, then worked the splice on arr3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment