SyntaxFix
Write A Post
Hire A Developer
Questions
I think it can't be simpler than this.
const findDuplicates = arr => [...new Set(arr.filter(v => arr.indexOf(v) !== arr.lastIndexOf(v)))]; console.log(findDuplicates([ "q", "w", "w", "e", "i", "u", "r"]));