My solution may be what you want
var data = {
"humans": [
{ "firstName" : "Paul", "lastName" : "Taylor", "hairs": 2 },
{ "firstName" : "Sharon", "lastName" : "Mohan", "hairs": 3 },
{ "firstName" : "Mohan", "lastName" : "Harris", "hairs": 3 },
{ "firstName" : "Deborah", "lastName" : "Goldman", "hairs": 4 },
{ "firstName" : "Mark", "lastName" : "Young", "hairs": 4 },
{ "firstName" : "Tom", "lastName" : "Perez", "hairs": 4 },
{ "firstName" : "Joseph", "lastName" : "Goldman", "hairs": 5 },
{ "firstName" : "Mary", "lastName" : "White", "hairs": 5 },
{ "firstName" : "Matthew", "lastName" : "Garcia", "hairs": 5 },
{ "firstName" : "Patricia", "lastName" : "Allen", "hairs": 5 },
{ "firstName" : "Larry", "lastName" : "Robinson", "hairs": 6 },
{ "firstName" : "Manb", "lastName" : "Lopez", "hairs": 6 },
{ "firstName" : "Jose", "lastName" : "Martinez", "hairs": 6 },
{ "firstName" : "Deborah", "lastName" : "Walker", "hairs": 6 },
{ "firstName" : "Joseph", "lastName" : "Lopez", "hairs": 6 },
{ "firstName" : "Tinman", "lastName" : "Moore", "hairs": 7 },
{ "firstName" : "Jose", "lastName" : "Jackson", "hairs": 7 },
{ "firstName" : "Karen", "lastName" : "Goldman", "hairs": 7 },
{ "firstName" : "Paul", "lastName" : "Taylor", "hairs": 7 },
{ "firstName" : "Amy", "lastName" : "Gonzalez", "hairs": 7 },
{ "firstName" : "Richard", "lastName" : "Martinez", "hairs": 7 }
]
};
var counterList = [];
$.each(data.humans,function(i,item){
counterList.push(item.hairs);
});
$.extend({
distinct : function(anArray) {
var result = [];
$.each(anArray, function(i,v){
if ($.inArray(v, result) == -1) result.push(v);
});
return result;
}
});
var uniqueCounterList= $.distinct(counterList);
var html = "";
$.each(uniqueCounterList,function(j,itemUnique){
html += "<div>Hair "+itemUnique+": "+(data.humans.filter(function(o) { return o.hairs == itemUnique }).length)+"</div>";
});
$("#count").html(html);
Or http://jsfiddle.net/8g5ggfeh/