Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Unique Elements

const getUnique = (arr) => [...new Set(arr)];

// Testing
const arr = [1, 1, 2, 3, 3, 4, 4, 4, 5, 5];
console.log(getUnique(arr));
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #Unique #Elements
ADD COMMENT
Topic
Name
5+4 =