DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
4+3 =
Submit