Spot the bug in customer deduplication

from Map and Set
Node 24 intermediate 4 min 1 issue to find

Find why customers with the same ID remain duplicated.

JavaScript
function uniqueCustomers(customers) {
  return [...new Set(customers)];
}

const customers = [{ id: 'U-1' }, { id: 'U-1' }];
console.log(uniqueCustomers(customers).length);
Open in playground
Report an error