Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Slice and Splice -Javascript 2

function frankenSplice(arr1, arr2, n) {
  // It's alive. It's alive!
  let localArr = arr2.slice();
  localArr.splice(n, 0, ...arr1);
  return localArr;
}
Source by forum.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #Slice #Splice
ADD COMMENT
Topic
Name
7+9 =