Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Remove Array Duplicate

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

console.log(removeDuplicates([1, 2, 3, 3, 4, 4, 5, 5, 6]));
// Result: [ 1, 2, 3, 4, 5, 6 ]
Source by dev.to #
 
PREVIOUS NEXT
Tagged: #Remove #Array #Duplicate
ADD COMMENT
Topic
Name
5+5 =