I have an associative array in my JS which I want to feed my Select.
These are the standard hours available that will refresh my availablehours (when page loads);
var standardhours = {
"09" : '9AM',
"10" : '10AM',
"11" : '11AM',
"12" : 'Noon',
"13" : '1PM',
"14" : '2PM',
"15" : '3PM',
"16" : '4PM',
"17" : '5PM',
"18" : '6PM',
"19" : '7PM'
};
These the available hours that I want to feed my Select.
var availablehours = {
"09" : '9AM',
"10" : '10AM',
"11" : '11AM',
"12" : 'Noon',
"13" : '1PM',
"14" : '2PM',
"15" : '3PM',
"16" : '4PM',
"17" : '5PM',
"18" : '6PM',
"19" : '7PM'
};
This is my dynamic variable that changes based on database changes. These are the hours taken by someone already.
takenHours = {"09", "18"};
I want to remove the takenHours from the availablehours associative array. Not sure how. The thought process I have feels very manual and simplistic.
takenHoursbe an array like this?takenHours = ["09", "18"];