DEV Community

Discussion on: Find Duplicates in an Array

Collapse
t0nyba11 profile image
Tony B • Edited on
const dupes = (a, h = []) => a.filter(x => (h[x] = (h[x] || 0) + 1) === 2);