There is an array of JSON objects named events that contains fields such as eventId, eventName, and the date of the event.
[{event1}, {event2}, {event3}];
The goal is to iterate through this array and filter out events that occur on the same day. The desired output should look like this:
"days": [
{
"date": "11-05-2015",
"events": [
{"eventId": 1, ...},
{"eventId": 2, ...},
{"eventId": 3, ...},
{"eventId": 4, ...},
]
},
What is the most efficient way to achieve this using JavaScript or Angular?