Steamroller - Does not accept solution

Tell us what’s happening:
Hello, I make a recursive function and when is running its doing right, but the evaluator report wrong in all. It would be a bug? Thank you!

Your code so far

var vect = [];
function recursion(arr)
    for(var i=0;i<arr.length; i++)

function steamrollArray(arr) {
  return vect;

steamrollArray([[["a"]], [["b"]]]) ;

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0.

Link to the challenge:

Move both the vect declaration and the recursion function inside steamrollArray function.

Your code contains global variables that are changed each time the function is run. This means that after each test completes, subsequent tests start with the new value. To fix this, make sure your function doesn’t change any global variables, and declare/assign variables within the function if they need to be changed.


var myGlobal = [1];
function returnGlobal(arg) {
  return myGlobal;
} // unreliable - array gets longer each time the function is run

function returnLocal(arg) {
  var myLocal = [1];
  return myLocal;
} // reliable - always returns an array of length 2

@RandellDawson, thank you, It’s working,

@ArielLeslie, that is something I didn’t know. Thank you for your response