title: Reduce Multi Dimensional Array
body: <p>I'm currently trying to map and reduce functions to flatten out a multidimensional array.<br>
  This is a mock example data set:</p>
  
  <pre><code>data: [
    {
      label: "Sort-01"
      data: [
        {
          label: "OCT-2017"
          weight: 2304
        },
        {
          label: "NOV-2017"
          weight: 1783
        }
      ]
    },
    {
      label: "Sort-02"
      data: [
        {
          label: "OCT-2017"
          weight: 4785
        },
        {
          label: "NOV-2017"
          weight: 102
        }
      ]
    },
   ......
  ]
  </code></pre>
  
  <p>I know in order to map-reduce by sort number I can use:</p>
  
  <pre><code>data.map(sort =&gt; sort.data.reduce((a,b) =&gt; a.weight + b.weight));
  </code></pre>
  
  <p>However, I want to reduce by the month instead of sort number.<br>
  I would appreciate any help.  </p>
  
  <p>Thanks,<br>
  Jay</p>