jquey
var uniqueArr = []; $.each(focusVotes, function(i, el){ if($.inArray(el, uniqueArr) === -1) uniqueArr.push(el); });
js
var arr = [9, 9, 111, 2, 3, 4, 4, 5, 7]; var sortedArr = arr.sort(); var results = []; for (var i = 0; i < arr.length - 1; i++) { if (sortedArr[i + 1] == sortedArr[i]) { results.push(sortedArr[i]); } } alert(results);