Implement the Slice and Splice Algorithm - Implement the Slice and Splice Algorithm

Tell us what’s happening:

can some one explain how to do it? i forgot the methods and what it does

Your code so far


Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36

Challenge Information:

Implement the Slice and Splice Algorithm - Implement the Slice and Splice Algorithm

1 Like

Please post what you have tried so far. We cannot write the answer for you, as that is against the forum rules.

Please try to write some code, even if it produces errors. it will give you a general idea of what you’re trying to solve and follow the lab instructions. Good luck!

you don’t even need to use slice and splice, you can implement the algorithm in whatever way that gives the wanted result

but if you want to review slice and splice I suggest researching them

1 Like

here’s the code i tried

function frankenSplice (arr1,arr2,index){
  const temp = arr2.slice()
 return temp.splice(index, 0, ...arr1);
  }

Ok, and how are you stuck working more on it?

You’re close! it looks like currently function returns removed elements, should it be returning that or something else like an array? Good luck!

1 Like