title: angular 4 - Add numbers from a nested array of a model
body: <p>I have an array of Model. Each object of this model has array of another model.
  I want to add all the respective number variables from nested array. My piece of code is as below</p>
  
  <p>Model</p>
  
  <p>TimesheetLogged.ts</p>
  
  <pre><code>export interface TimesheetLogged {
      ProjectId: string,   
      MondayHours: number,
      TuesdayHours: number,
      WednesdayHours: number,
      ThursdayHours: number,
      FridayHours: number,
      SaturdayHours: number,
      SundayHours: number   
  }
  </code></pre>
  
  <p>Project.ts</p>
  
  <pre><code>import { TimesheetLogged } from "./TimesheetLogged";
  
  export interface Project {
      ProjectId: number;  
      TimeLoggedHours: TimesheetLogged[];   
  }
  </code></pre>
  
  <p>Piece of code from Component</p>
  
  <pre><code>public Projects: Project[];
  //Get projects data from database and subscribe to Projects object  Successfully
  
  let chartData: Array&lt;number&gt; = [];
      let mon:number= 0;
      let tue:number= 0;
      let wed:number= 0;
      let thu:number= 0;
      let fri:number= 0;
      let sat:number= 0;
      let sun:number= 0;
  
      this.Projects.forEach((empHours) =&gt; {
          empHours.TimeLoggedHours.forEach((hours) =&gt; {
              a =&gt; {
                  mon += a.MondayHours;
                  tue += a.TuesdayHours;
                  wed += a.WednesdayHours;
                  thu += a.ThursdayHours;
                  fri += a.FridayHours;
                  sat += a.SaturdayHours;
                  sun += a.SundayHours;
              }  
          });            
      });
      chartData.push(mon);
      chartData.push(tue);
      chartData.push(wed);
      chartData.push(thu);
      chartData.push(fri);
      chartData.push(sat);
      chartData.push(sun); 
  </code></pre>
  
  <p>However I am getting Sum of all number variables as </p>
  
  <p>[object Array][0, 0, 0, 0, 0, 0, 0]</p>
  
  <p>Any update required in this code. Any other simpler solution is welcome.</p>