Slice and Splice, need more help

Slice and Splice, need more help
0.0 0

#1

Tell us what’s happening:
So I almost got the answer but one of the strings is missing ‘tentacle’.

Your code so far


function frankenSplice(arr1, arr2, n) {
   var brandNewArr = [];
      for(let i = 0; i < arr1.length; i++) { 
          var newArr = [];
          arr2.splice(n+i, 0, arr1[i]);
          newArr.push(arr2);
          for(let j = 0; j < newArr.length; j++) {
              return newArr[j];
          }
          brandNewArr.push(newArr[j]);  
      }
      
    return brandNewArr;
}

frankenSplice(["claw", "tentacle"], ["head", "shoulders", "knees", "toes"], 2);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/slice-and-splice


#2

A post was merged into an existing topic: Slice and Splice. I need help


#3