var arNames = [
"value1",
"value3",
"value3",
"value1",
"value1",
"value6",
"value6"
];
var result = arNames.reduce(function(map, item) {
map[item] = (map[item] || 0) + 1;
return map;
}, Object.create(null));
s=""
for (i in result) s+="<span>"+i+"</span>\t-\t"+"<span>"+result[i]+"</span>\n"
alert(s)
// <span>value1</span> - <span>3</span>
// <span>value3</span> - <span>2</span>
// <span>value6</span> - <span>2</span>