Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Filtering an array for unique values

const my_array = [1, 2, 2, 3, 3, 4, 5, 5]
const unique_array = [...new Set(my_array)];
console.log(unique_array); // [1, 2, 3, 4, 5]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Filtering #array #unique #values
ADD COMMENT
Topic
Name
5+8 =