title: Split array of objects into new arrays based on year of object's date
body: <p>I have an array of objects called <strong>objarray</strong>. Each object looks like this:</p>
  
  <pre><code>var object = {
      age: "45"
      coords: "-37.807997 144.705784"
      date: Sun Jul 28 2002 00:00:00 GMT+1000 (EST)
  }
  </code></pre>
  
  <p>(<strong>date</strong> is a Date object)</p>
  
  <p>I need to push each object into a new array based on the date. I want the end result to look like this:</p>
  
  <pre><code>var dateGroups = [[object, object, object],[object, object], [object, object, object]];
  </code></pre>
  
  <p>Each array within <strong>dateGroups</strong> contains objects with the same date.</p>
  
  <p>Is this possible to do with arrays? Previously I generated a new object which contained all the <strong>objarray</strong> objects grouped by date (dates generated from the data):</p>
  
  <pre><code>var alldates = {
    "1991" : [object, object, object],
    "1992" : [object, object],
    //etc...
  }
  </code></pre>
  
  <p>The above seems like a weird solution in practice though, I only need to be able to access the objects by year: i.e. <strong>dateGroups[0]</strong> = array of objects from the first year</p>
  
  <p>How would I get the data into something like the <strong>dateGroups</strong> array? Is there a better way to store this type of data? </p>