What's wrong with my steamroller

What's wrong with my steamroller
0

#1

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.


#2

Please edit your original post to include a link to the challenge url. It helps others test your code faster.

Thank you.