Having trouble figuring out how to solve a problem with manipulating an Object Array called items. The array contains four items in total.
const items: any[] = await sp.web.lists.getByTitle("List")
.items.select("ID, Part, Level, MyDate")
.filter("Part eq 1")
.getAll();
The issue I'm facing is how to manipulate the Array to achieve the following:
- Identify and remove duplicates for Level, leaving only one of each value;
- From the remaining unique values, eliminate the item with the oldest Date.
Unfortunately, I haven't been able to find a solution through my own research yet. Any help from the community would be greatly appreciated!