title: Sort an array of Objects by a value with lodash or JS
body: <p>Trying to sort an array of objects:</p>
  
  <pre><code>mainObject = {
    august: [],
    december: []
  }
  </code></pre>
  
  <p>Each array contains multiple objects with different dates and ticket info.</p>
  
  <pre><code>mainObject = {
    august: [ 
      { date: "2016-08-22", ticket: "parking" },
      { date: "2016-08-14", ticket: "speeding" },
      { date: "2016-08-29", ticket: "parking" }
    ],
    december: [
      { date: "2016-12-06", ticket: "parking" },
      { date: "2016-12-30", ticket: "parking" },
    ]
  }
  </code></pre>
  
  <p>I print each ticket into my template, but would like them sorted ascending by date. In this case, I'd like to sort the information, before passing this data to the template, how can I do with with Lodash or otherwise?</p>
  
  <p>I have attempted variations of:</p>
  
  <pre><code>_.sortBy(mainObject, [function(d) { return d.date; }]); // date =&gt; undefined
  </code></pre>
  
  <p>I've also tried getting deeper into the object first:</p>
  
  <pre><code>_.forEach(mainObject, function(month) {
    _.sortBy(mainObject, [function(d) { return d.date; }]);
  }
  </code></pre>
  
  <p>The above doesn't work either.</p>