const arr = ["q", "w", "w", "e", "i", "u", "r"] arr.reduce((acc, cur) => { if(acc[cur]) { acc.duplicates.push(cur) } else { acc[cur] = true //anything could go here } }, { duplicates: [] })