I have an array of objects which contain a "location" key. I already filtered and mapped the events array to a new visitedlocations array so that it only contains the locations. Now I can't figure out how to filter out the most occuring item in the visitedLocations array. Anyone have an idea?
How i filtered the events array:
const visitedLocations = state.events
.filter((event) => event.timeline.startDate < today)
.map((event) => {
return event.location;
});