title: Remove inner element from JSON array in Angular
body: <p>I have the following JSON array.</p>
  <pre><code>[{
      &quot;Group&quot;: &quot;Title1&quot;,
      &quot;subGroup&quot;: [{
          &quot;name&quot;: &quot;Test1&quot;,
          &quot;id&quot;: 3
      }, {
          &quot;name&quot;: &quot;Hello&quot;,
          &quot;id&quot;: 4
      }]
  },
   {
      &quot;Group&quot;: &quot;Title2&quot;,
      &quot;subGroup&quot;: [{
          &quot;name&quot;: &quot;Test2&quot;,
          &quot;id&quot;: 5
      }, {
          &quot;name&quot;: &quot;Test2&quot;,
          &quot;id&quot;: 6
      }]
  }]
  </code></pre>
  <p>I want to remove the entire JSON object only if name = &quot;Hello&quot;. I have the following code</p>
  <pre><code>  let deleteIndex=-1;
      MyData.forEach(sampleData =&gt; {
        deleteIndex = sampleData.subGroup.findIndex(data=&gt; data.name === 'Hello');
        console.log(deleteIndex);
        delete sampleData.subGroup[deleteIndex];
      });
      console.log(JSON.stringify(MyData));
    }
  </code></pre>
  <p>Unfortunately, this is not working. I want data like this</p>
  <pre><code> [{
          &quot;Group&quot;: &quot;Title1&quot;,
          &quot;subGroup&quot;: [{
              &quot;name&quot;: &quot;Test1&quot;,
              &quot;id&quot;: 3
          }]
      },
       {
          &quot;Group&quot;: &quot;Title2&quot;,
          &quot;subGroup&quot;: [{
              &quot;name&quot;: &quot;Test2&quot;,
              &quot;id&quot;: 5
          }, {
              &quot;name&quot;: &quot;Test2&quot;,
              &quot;id&quot;: 6
          }]
      }]
  </code></pre>