Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove duplicate Array

let Arr = [1,2,2,2,3,4,4,5,6,6];

//way1
let unique = [...new Set(Arr)];
console.log(unique);

//way2
function removeDuplicate (arr){
	return arr.filter((item,index)=> arr.indexOf(item) === index);
}

removeDuplicate(Arr);

Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #duplicate #Array
ADD COMMENT
Topic
Name
1+1 =