Yes, use the developer’s console which is built into your browser. It’s a thing most modern browsers include, as (for the most part) developers are using the browsers for building and testing code.
But in your code, you don’t actually output the array to the console. The tests might, but as a developer, it’s a useful thing to know how. Looking at your code, note the line I’m adding:
function frankenSplice(arr1, arr2, n){
let tempArr2=arr2.slice(0);
tempArr2.splice(n, 0, arr1);
// Use this for debugging your code, and make sure the developer
// tools are open.
console.log(tempArr2);
return tempArr2;
}
That’s an easy way to see what’s going on in the array. However, I tend to go one step further, as the developer console in Chrome does some weirdness:
function frankenSplice(arr1, arr2, n){
let tempArr2=arr2.slice(0);
tempArr2.splice(n, 0, arr1);
// This takes your array, and represents it as a string, then outputs
// that to the console. Again, use your dev tools!!
console.log( JSON.stringify( tempArr2 ) );
return tempArr2;
}
The reason I use this approach is that I find it easier to view the array as a string, and because once I have that string, the browser won’t be changing the string value on me.
But here’s what you’ll get when you run that second one, popping up in the console:
[4,[1,2,3],5,6] VM178:9
[4,[1,2,3],5] VM178:9
["a",[1,2],"b"] VM178:9
["head","shoulders",["claw","tentacle"],"knees","toes"] VM178:9
[[1,2,3,4]] VM178:9
That bit on the right side isn’t really relevant for your use, but that left side definitely is. That is the actual value of tempArr before you return it. Each pair of [...] indicates an array. What you’re being told is that you are returning
[4,[1,2,3],5,6]
when the test is looking for
[4,1,2,3,5,6]
Can you see the difference?