Looking for help transforming this schedules array to match the desired output. Any ideas?
let schedules = [
{day: 'Sunday', time: '5:00 PM'},
{day: 'Monday', time: '4:00 PM'},
{day: 'Monday', time: '12:00 PM'},
{day: 'Tuesday', time: '1:00 PM'}
]
let output = [
{day: 'Sunday', time: '5:00 PM'},
[
{day: 'Monday', time: '4:00 PM'},
{day: 'Monday', time: '12:00 PM'}
],
{day: 'Tuesday', time: '1:00 PM'}
]