Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript remove duplicates from array

var myArr = [1, 2, 2, 2, 3];
var mySet = new Set(myArr);
myArr = [...mySet];
console.log(myArr);
// 1, 2, 3
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #remove #duplicates #array
ADD COMMENT
Topic
Name
4+4 =