title: Sum of nested object values in Array using Javascript
body: <p><strong>I want to get sum of <em>exercise</em></strong>. I'm trying to get sum of exercise of both Course array element.** 
  Trying to use reduce method on individual array element but cant get sum.
  I tried forOf and forIn loop to do but i'm not able to solve this problem.</p>
  
  <pre><code>const courses = [
  {
    name: "Half Stack application development",
    id: 1,
    parts: [
      {
        name: 'Fundamentals of React',
        exercises: 10,
        id: 1
      },
      {
        name: 'Using props to pass data',
        exercises: 7,
        id: 2
      },
      {
        name: 'State of a component',
        exercises: 14,
        id: 3
      },
      {
        name: 'Redux',
        exercises: 11,
        id: 4
      }
    ]
  }, 
  {
    name: "Node",
    id: 2,
    parts: [
      {
        name: 'Routing',
        exercises: 3,
        id: 1
      },
      {
        name: 'Middleware',
        exercises: 7,
        id: 2
      }
    ]
  }
  </code></pre>
  
  <p>]</p>