title: Remove objects with a duplicate property from a javascript array
body: <p>I have a javascript array that contains several objects, each object having this format:</p>
  
  <pre><code>{'hits':21, 'date':2011-01-11, 'business_id':233}
  </code></pre>
  
  <p>I am using a sorting function to sort the array objects:</p>
  
  <pre><code>    my_array.sort(function(a, b){
          return b.hits-a.hits;
      });
  </code></pre>
  
  <p>This sorting results in having some adjacent objects with the same 'business_id'. I would like to remove the ones with duplicate 'business_id's to keep only the one of the duplicates having the newest date value.</p>
  
  <p>How do I remove the objects from the array that have duplicate 'business_id', keeping the one with the newest 'date' value? Can I do it in the sort function, or with some filter function?</p>