Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js get distinct values from array

var myArray = ['a', 1, 'a', 2, '1'];

let unique = [...new Set(myArray)];

console.log(unique); // unique is ['a', 1, 2, '1']
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #distinct #values #array
ADD COMMENT
Topic
Name
2+4 =