In my scenario, I have a list of days where employees are scheduled to work. However, on the website, I need to display the remaining days as leave. In cases where an employee has two different shifts, there can be two elements in the object.
var WorkDays = [{day:3}, {day:3}, {day:1}, {day:1}, {day:0}];
var days = [0, 1, 2, 3, 4, 5, 6}];
The newly updated WorkDays array should look like this:
WorkDays = [{day:0}, {day:1}, {day:1},{day:2}, {day:3}, { day:3} ,{ day:4}, {day:5}, {day:6}];