title: Create a new array using child array, but include parent array information
body: <p>I have the following JSON array:</p>
  
  <pre><code>var results= "[{
              "name": "Duncan",
              "age": 23,
              "children": [{
                      "nickname": "John"
                  },
                  {
                      "nickname": "Susan"
                  }
              ]
          },
          {
              "name": "Mike",
              "age": 30,
              "children": [{
                  "nickname": "Don"
              }]
          },
          {
              "name": "Chad",
              "age": 40,
              "children": []
          }
      ]"
  </code></pre>
  
  <p>I would like to create an array from the above, such that it looks like this:</p>
  
  <pre><code>[{
          "nickname": "John",
          "age": 23,
          "name": "Duncan"
      },
      {
          "nickname": "Susan",
          "age": 23,
          "name": "Duncan"
      },
      {
          "nickname": "Don",
          "age": 30,
          "name": "Mike"
      }
  ]
  </code></pre>
  
  <p>In my example, since chad had no children, that entry should be ignored.</p>
  
  <p>I have tried to do this, but it didn't work.</p>
  
  <pre><code>allChildren: any[] = [];
  
  for (let i=0;i&lt;this.results.length;i++)
    {
      if(this.results[i].children.length &gt; 0)
      {
      this.allChildren = [...this.allChildren, ...this.results[i].children]
      this.allChildren[i]["name"] = this.results[i].name
      this.allChildren[i]["age"] = this.results[i].age
      }
    }
   console.log(this.allChildren)
  </code></pre>