I have below array of objects
const array = [
{ home1: "05:45", dayOfWeek: 1, away: "09:30"},
{ home1: "05:15", dayOfWeek: 2, away: "09:30"},
{ home1: "17:30", dayOfWeek: 5, away: "09:30"},
{ home1: "16:30", dayOfWeek: 7, away: "09:30"}
]
I have four dayOfWeek (1,2,5,7). Now I need to push the remaining three (3,4,6) with the dummy object ({ home1: "05:30", dayOfWeek: 7, away: "09:30"})
Now the logical part is I don't know which dayOfWeek are present in the array. There may be only one, two, three or blank. I need to push 7 days in that array every time.
How this can be done? Please suggest me the best way
Thank you!!!