set17

Dedupe a signup list by email

17 / 26
read the snippet · pick its Big-O
// Keeps the first occurrence of each email.
function dedupeByEmail(users) {
return users.filter(
(u, i) => users.findIndex((x) => x.email === u.email) === i
);
}