Slice and Splice (Not solving with good result)

Hey guys, I got good results, but I still can’t complete this challenge. Thanks for help.

function frankenSplice(arr1, arr2, n) {
  let resultArray = [];
  resultArray = arr2.slice(n);
  resultArray.unshift(arr2.slice(0, n));
  return resultArray;

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

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36.

Link to the challenge:

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.


You don’t quite get the right result. I suggest you start using the browser console, or use JSON.stringify() inside the console.log so that i appear also in the fcc console

Your output is this:

[ [ 'head', 'shoulders' ],
  [ 'claw', 'tentacle' ],
  'toes' ]

Oh, thanks. Now I get that is wrong :wink: