I have an array of arrays. Some of the arrays have multiple arrays within them that I'd like to flatten. Here is what I cam up with:

```
_(o).forEach(function(array) {
    for (var i=0; i<= array.length; i++){
        if(array[i].length > 1) {
            _.flatten(array)
        }
    }
});

```

This is the array of arrays in my JS console.

```
[Array[1], Array[1], Array[1], Array[1], Array[1], Array[1], Array[1]]

```

Here's another look at them, where you can see that some arrays have more than one array within them.

```
    0: Array[1]0: Array[1]length: 1__proto__: Array[0]
    1: Array[1]0: Array[1]length: 1__proto__: Array[0]
    2: Array[1]0: Array[1]length: 1__proto__: Array[0]
    3: Array[1]0: Array[1]length: 1__proto__: Array[0]
    4: Array[1]0: Array[2]length: 1__proto__: Array[0]
    5: Array[1]0: Array[2]length: 1__proto__: Array[0]
    6: Array[1]0: Array[1]length: 1__proto__: Array[0]
    length: 7 __proto__: Array[0]

```

I get the following error: Cannot read property 'length' of undefined

What am I doing wrong?

I'm starting with the following object:

```
Object {OPxE8PPWuC: Array[1], Pxfus72LQL: Array[1], YUiapfcXac: Array[1], fTfCZU1zFs: Array[1], kTC0RwDalJ: Array[2]…}
OPxE8PPWuC: Array[1]
Pxfus72LQL: Array[1]
YUiapfcXac: Array[1]
fTfCZU1zFs: Array[1]
kTC0RwDalJ: Array[2]
yCDDEWoiwM: Array[2]
zP8ZcapePl: Array[1]
__proto__: Object

```

There are 8 arrays in that object but two of the arrays have two arrays within them. I'd like to have 8 arrays but each of the arrays would be one level deep. The two arrays that have two arrays, I'd merge them into one bigger array.