Is there someone who is familiar with functional programming in javascript that can help me parse this data from google place API:
`periods: [
{ close: { day: 1, time: '1400' }, open: { day: 1, time: '1100' } },
{ close: { day: 1, time: '2200' }, open: { day: 1, time: '1900' } },
{ close: { day: 2, time: '1400' }, open: { day: 2, time: '1100' } },
{ close: { day: 2, time: '2200' }, open: { day: 2, time: '1900' } },
{ close: { day: 3, time: '1400' }, open: { day: 3, time: '1100' } },
{ close: { day: 3, time: '2200' }, open: { day: 3, time: '1900' } },
{ close: { day: 4, time: '1400' }, open: { day: 4, time: '1100' } },
{ close: { day: 4, time: '2200' }, open: { day: 4, time: '1900' } },
{ close: { day: 5, time: '1400' }, open: { day: 5, time: '1100' } },
{ close: { day: 5, time: '2200' }, open: { day: 5, time: '1900' } },
{ close: { day: 6, time: '2200' }, open: { day: 6, time: '1100' } },
];`
so each entry in the array is an object. The object contains open and close object that represent the day of the week and opening/closing hour.
This place is open from 11:00 - 14:00 and 19:00 - 22:00 during weekdays. 11:00 - 22:00 on Saturdays. Closed on Sundays because no entry has got the day : 0.
How can I use functional programming to parse this array into an array like this:
`openingHours = [
"Sundays: Closed"
"Mondays: 11:00 - 14:00 and 19:00 - 22:00",
"Tuesdays: 11:00 - 14:00 and 19:00 - 22:00",
"Wednesdays: 11:00 - 14:00 and 19:00 - 22:00",
"Thursdays: 11:00 - 14:00 and 19:00 - 22:00",
"Fridays: 11:00 - 14:00 and 19:00 - 22:00",
"Saturdays: 11:00 - 22:00"
]`