Pt deduplicare de poate folosi codul din subiectul anterior al op-ului
Intr-o functie si gata
function removeDupes(arg) {}