title: Construct flat array from tree of objects
body: <p>Suppose I have a tree of objects like the following, perhaps created using the excellent algorithm found here: <a href="https://stackoverflow.com/a/22367819/3123195">https://stackoverflow.com/a/22367819/3123195</a></p>
  
  <pre><code>{
      "children": [{
          "id": 1,
          "title": "home",
          "parent": null,
          "children": []
      }, {
          "id": 2,
          "title": "about",
          "parent": null,
          "children": [{
              "id": 3,
              "title": "team",
              "parent": 2,
              "children": []
          }, {
              "id": 4,
              "title": "company",
              "parent": 2,
              "children": []
          }]
      }]
  }
  </code></pre>
  
  <p>(Specifically in this example, the array returned by that function is nested as the <code>children</code> array property inside an otherwise empty object.)</p>
  
  <p>How would I convert it back to a flat array?</p>