Tell us what’s happening:
I have been running this code on mycomputer and it works, however when it comes to here, it gives error, any idea? Your code so far
I feel that you may be a bit confused as to what you are seeing in the browser console. When you call the function as you do in your example this is the outcome, and where the test wants an array that holds arrays that have strings in them which would look like [["a"],["b"]], what we have instead from your initial solution is an array that holds arrays which themselves hold an array which holds a string and that looks like [[["a"]],[["b"]]] which is not correct, but it is the expected outcome of the function you’ve written as you were pushing the return value of splice inside its own array, but splice already returns an array so you were always pushing a 2D array into a 1D array each time effectively making it a 3D array