Here is my solution to the problem

```
function steamrollArray(arr) {
// I'm a steamroller, baby
var result = [];
for (var i = 0; i < arr.length; i++) {
if (Array.isArray(arr[i])) {
result = result.concat(steamrollArray(arr[i]));
} else {
result.push(arr[i]);
}
}
return result;
}
```

However, the logic of the line

`result = result.concat(steamrollArray(arr[i]));`

I got from googling and found it on stackoverflow. I do understand it’s recursion, and I do understand the logic partly, but not as clearly as I would like to.

It would be greatly appreciated if anyone gives me a clear explanation what really happens here. Thanks forward!