title: How to sort an object array by date property?
body: <p>Say I have an array of a few objects:</p>
  <pre><code>var array = [{id: 1, date: Mar 12 2012 10:00:00 AM}, {id: 2, date: Mar 8 2012 08:00:00 AM}];
  </code></pre>
  <p>How can I sort this array by the date element in order from the date closest to the current date and time down? Keep in mind that the array may have many objects, but for the sake of simplicity I used 2.</p>
  <p>Would I use the sort function and a custom comparator?</p>