Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to find unique elements in array in javascript

let a = ["1", "1", "2", "3", "3", "1"];
let unique = a.filter((item, i, ar) => ar.indexOf(item) === i);
console.log(unique);
 
PREVIOUS NEXT
Tagged: #find #unique #elements #array #javascript
ADD COMMENT
Topic
Name
6+9 =