title: How get all 'name' values in a json array?
body: <p>I am making an application in Angular. I Have a Json file.
  How get all 'name' values in the array?
  Let's say that at the output I could get something like:</p>
  <pre><code>['Sony', 'Apple', 'Sony']
  </code></pre>
  <p>Json:</p>
  <pre><code>[
    {
      &quot;Data&quot;: [
          {
              &quot;name&quot;: &quot;Sony&quot;,
              &quot;color&quot;: &quot;black&quot;
          }            
      ] 
  },
  {
      &quot;Data&quot;: [
          {
              &quot;name&quot;: &quot;Apple&quot;,
              &quot;color&quot;: &quot;white&quot;
          }            
      ] 
  },
  {
      &quot;Data&quot;: [
          {
              &quot;name&quot;: &quot;Sony&quot;,
              &quot;color&quot;: &quot;red&quot;
          }            
      ] 
    }
  ]
  </code></pre>
  <p>app.component:</p>
  <pre><code>import { Component, OnInit } from '@angular/core';
  import resData from '../assets/result.json';
  
  @Component({
   selector: 'app-root',
   templateUrl: './app.component.pug',
   styleUrls: ['./app.component.styl']
  })
  
  export class AppComponent {
   tasks: any = resData;   
   console.log(this.tasks); //While displaying just array
  }
  </code></pre>