So I was doing the Simple calendar task in the end of this page:
My solution was a bit different from the one provided, but still I can’t understand what’s wrong with mine - why won’t it work.
Here’s the conditional statement snippet with my solution in it.
select.onchange = function() {
const choice = select.value;
//the code below was done by me
let days;
if (choice===‘January’ || choice===‘March’ || choice===‘May’ || choice===‘July’ || choice===‘August’ || choice===‘October’ || choice===‘December’) {
days = 31;
} else if (choice===‘April’ || choice===‘June’ || choice===‘September’ || choice===‘November’) {
days = 30;
} else if (choice===‘February’) {
days = 28;
}
//the code above was done by me
createCalendar(days, choice);
}