Count occurrences of array objects
<p>I'm looking to create an array of counts based on the occurrences of the same object within a different array. So far, my code looks like this:</p>

<pre><code>var dates = [];
$.each(items, function (i, item) {
    dates.push(item.date);
});
</code></pre>

<p>which returns:</p>

<pre><code>['2013/03', '2013/03', '2012/01', '2012/11', '2012/09', '2012/09', '2012/09']
</code></pre>

<p>After that, I'd like to end up with an array that looks like this:</p>

<pre><code>[2,1,1,3]
</code></pre>

<p>Any help would be much appreciated! </p>
