Created
June 22, 2020 10:46
-
-
Save berat/fec833c313f036d56c0e49a4284cd631 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let arr = [1, 2, 3, 3, 4, 5, 6, 7, 7, 7]; | |
const findDuplicates = (arr) => arr.filter(( item, index ) => arr.indexOf(item) != index); | |
console.log([...new Set(findDuplicates(arr))]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment