Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery get unique values from array

var a = [ 1, 5, 1, 6, 4, 5, 2, 5, 4, 3, 1, 2, 6, 6, 3, 3, 2, 4 ];

var unique = a.filter(function(itm, i, a) {
    return i == a.indexOf(itm);
});

console.log(unique);
 Run code snippet
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #unique #values #array
ADD COMMENT
Topic
Name
9+4 =