deep flatten all items in collection using lodash
<p>I'm looking to flatten an array that look like this:</p>

<pre><code>[{
    "id": 0,
    "text": "item 0"
}, {
    "id": 1,
    "items": [{
        "id": 2,
        "text": "item 2"
    }, {
        "id": 3,
        "items": [{
            "id": 4,
            "text": "item 4"
        }]
    }]
}]
</code></pre>

<p>into this</p>

<pre><code>[{
    "id": 0,
    "text": "item 0"
}, {
    "id": 2,
    "text": "item 2"
}, {
    "id": 4,
    "text": "item 4"
}]
</code></pre>

<p>basically keeping all element that doesn't have an "items" property, and if they have one, recursively traverse all "items" arrays deep.</p>

<p>I could indeed write a recursive function, but I'm looking for a nice looking lodash or underscore way to solve this.</p>