title: Iterate through array of objects and obtain a new array of object
body: <p>I have below array of objects with each object having a <code>projects</code> attribute which further has its array of objects.</p>
  <pre><code>const data = [
      {
          &quot;title&quot;: &quot;Release&quot;,
          &quot;projects&quot;: [
              {
                  &quot;name&quot;: &quot;Server&quot;,
                  &quot;result&quot;: {
                      &quot;success&quot;: 0,
                      &quot;failure&quot;: 100
                  },
              }
          ]
      },
      {
          &quot;title&quot;: &quot;Payments&quot;,
          &quot;projects&quot;: [
              {
                  &quot;name&quot;: &quot;Platform1&quot;,
                  &quot;result&quot;: {
                      &quot;success&quot;: 100,
                      &quot;failure&quot;: 0
                  }
              },
              {
                  &quot;name&quot;: &quot;Platform2&quot;,
                  &quot;result&quot;: {
                      &quot;success&quot;: 50,
                      &quot;failure&quot;: 50,
                  }
              }
          ]
      }
  ]
  </code></pre>
  <p>I wanted to iterate through it and get the result as follows. <code>name</code> is nothing but concatenation of <code>title</code> and <code>name</code> from above data.</p>
  <pre><code>
  const result = [
      {
        name: 'Release-Server',
        success: 0,
        failure: 100,
      },
      {
        name: 'Payments-Platform1',
        success: 100,
        failure: 0,
      },
      {
        name: 'Payments-Platform2',
        success: 50,
        failure: 5,
      },
  ];
  </code></pre>
  <p>I have tried below ways but not able to figure out how to get exactly the result as shown above. can someone pls help on this.</p>
  <pre><code>data.forEach(prj =&gt; {
          prj.projects.forEach((project) =&gt; {
            // unable to get how to push these details into a new array of object
          })
        });
  </code></pre>