0

I need some help with iterating through this array object

arrayObject = [
  { email: 'james', isStatusUpdates: false, isPickedUp: true, isDelivered: false },
  { email: 'james', isStatusUpdates: false, isPickedUp: false, isDelivered: false },
  { email: 'james', isStatusUpdates: true, isPickedUp: false, isDelivered: false },
  { email: 'john', isStatusUpdates: true, isPickedUp: true, isDelivered: true }
]

How I can check the duplicate value in "email" property and then I can merge the others properties so that I can have the output like this:

arrayObject = [
  { email: 'james', isStatusUpdates: true, isPickedUp: true, isDelivered: false },
  { email: 'john', isStatusUpdates: true, isPickedUp: true, isDelivered: true }
]
James
  • 99
  • 1
  • 1
  • 5
  • Please check: https://stackoverflow.com/questions/1960473/get-all-unique-values-in-a-javascript-array-remove-duplicates i believes it solves your problem – davidmpaz Apr 15 '20 at 05:55
  • I have checked your link but I need to combine the "merge" part beside the checking unique value – James Apr 15 '20 at 06:14
  • Hi @James, I know. I was trying to get you into the point were you find by yourself the full solution. Getting already made solutions will not help you learn anything ;-) – davidmpaz Apr 15 '20 at 07:19

0 Answers0