Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript find unique values in array

// usage example:
var myArray = ['a', 1, 'a', 2, '1'];
var unique = myArray.filter((v, i, a) => a.indexOf(v) === i); 

// unique is ['a', 1, 2, '1']
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #find #unique #values #array
ADD COMMENT
Topic
Name
7+6 =