I don’t quite understand why my steamroller is not working.
Please what’s wrong with my code?
function steamrollArray(arr) {
// I'm a steamroller, baby
let result=[];
arr.map((num)=> {
typeof(num) ==='object'? steamrollArray(num) :result.push(num);
});
return result;
}
Link to challenge: https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/steamroller
Thanks.