Tell us what’s happening:
So, this code solves all the problems, but it’s not passing the test and I don’t know why. Anybody have any ideas? Thank you for your help.
Your code so far
var good=[];
function steamrollArray(arr) {
for(var i = 0; i<arr.length; i++){
if(Array.isArray(arr[i])){
var newArr = steamrollArray(arr[i]);
}else{
good.push(arr[i]);
}
}
return good ;
}
steamrollArray([1, {}, [3, [[4]]]]);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/steamroller