Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

duplicate numbers in an array javascript

[1, 1, 2, 2, 3].filter((element, index, array) => array.indexOf(element) !== index) // [1, 2]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #duplicate #numbers #array #javascript
ADD COMMENT
Topic
Name
6+4 =