What's wrong with my steamroller

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

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

Thank you.

1 Like