var arr = [1,2,5,1,2,5,6,7,2]; var uniqued = arr.filter(function(e,i,a){return i == a.indexOf(e)}); alert( uniqued );