Get count of most common property-value in a list of json-objects : <p>Given data like</p>

<pre><code>var data = [
    {
        "a" : "x"
        ... (other properties)
    },
    {
        "a" : "x"
        ... (other properties)
    },
    {
        "a" : "y"
        ... (other properties)
    },
]
</code></pre>

<p>The count of the most common "a"-property value would be 2, (for "x").</p>

<p>Now, what would be the cleanest way to get this from <code>data</code>?</p>

<p>I assume there might be a nice way to generate an array of the different counts, i.e. <code>[ 2 , 1 ]</code> in this case, and then run <code>Math.max(...array)</code> on this?</p>

<p>But I can't seem to find a clean way of doing this?</p>
