title: Why do I get TypeError: _this.data.forEach is not a function
body: <p>I am trying to retrieve data from the backend. These are the relevant parts of my code:</p>
  
  <h2>API call</h2>
  
  <pre><code>getData(PrimaryId:number):Observable&lt;DataDto[]&gt;{
    return this.httpClient.get(`${this.prefix}/&lt;xyz&gt;/${PrimaryId}/xyz`) as Observable&lt;DataDto[]&gt;
  }
  </code></pre>
  
  <h2>Component TypeScript</h2>
  
  <pre class="lang-js prettyprint-override"><code>onRetrieveClicked() {
    this.xyzService.getData(this.PrimaryId).subscribe(
      (xyz: DataDto[]) =&gt; {
        this.xyz = xyz
        console.log(this.xyz)
        console.log(this.xyz.forEach((data)=&gt;data.name) 
    })
  }
  </code></pre>
  
  <h2>First console.log output</h2>
  
  <pre><code>{content: Array(1), pageable: {…}, totalPages: 1, totalElements: 1, last: true, …}
         content: Array(1)
         0: {name: max, name: null, asset: null,  …}
         length: 1
         ..........
  </code></pre>
  
  <p>But when I try to print only the name in the second console, it says that forEach is not a function. How can I solve this</p>
  
  <p><strong>edit</strong>
  <strong>Dto model</strong></p>
  
  <pre><code>export interface DataDto {
  name: string
  asset: abcDto 
  status: StatusDto 
  tasks: efgDto[]
  nextDate: string
  }
  </code></pre>