Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check for duplicates in array javascript

[1, 2, 3].every((e, i, a) => a.indexOf(e) === i) // true

[1, 2, 1].every((e, i, a) => a.indexOf(e) === i) // false
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #duplicates #array #javascript
ADD COMMENT
Topic
Name
2+8 =