Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript remove duplicated from Array

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: #javascript #remove #duplicated #Array
ADD COMMENT
Topic
Name
1+4 =