Once I received various user images, the resulting array looks like this:
[
{ label: "portrait", owner: "Jon" },
{ label: "house", owner: "Jim" },
{ label: "portrait", owner: "Jim" },
{ label: "portrait", owner: "Jane" },
{ label: "cat", owner: "Jane" }
]
In order to highlight entries with duplicate label
values in the array (in this case: "portrait"), I am seeking assistance.
Ideally, I would like to flag items with a repeat occurrence of the label
, distinguishing between those flagged as A for being repeated later in the array and those flagged as B for being the final occurrence (for example, both Jon's and Jim's portraits are flagged as A, while Jane's is flagged as B).
Any support provided on this matter would be greatly valued!