Following are code snippet::
let dayOfWeek=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]
let officeHoursList: [
{dayOfWeek: "Wednesday", beginHour: "08:30 AM", endHour: "04:30 PM"}]
Here I need to compare both of the array and if the dayOfWeek is not present into the officeHoursList then it will add remaining dayOfWeek into the officeHoursList.
For Example in this case the final output would be
officeHoursList: [
{dayOfWeek: "Monday", beginHour: "00:00 AM", endHour: "00:00 PM"},
{dayOfWeek: "Tuesday", beginHour: "00:00 AM", endHour: "00:00 PM"},
{dayOfWeek: "Wednesday", beginHour: "08:30 AM", endHour: "04:30 PM"},
.
.
.
{dayOfWeek: "Sunday", beginHour: "00:00 AM", endHour: "00:00 PM"}]
Here the value of array officeHoursList is dynamic in this case it is only contains the Wednesday but it would be any dynamic value from Monday to Sunday.
Thanks in Advance
beginHour: "00:00 AM", endHour: "00:00 PM"? Please show the code that you have attempted so that we may help you fix it.