I have the following code and I want to know if there is a better way to simplify it.
I need to use simple data structures (yes, for each, etc.)
function amountDayMonth(month) {
let amountDayMonth
if(month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) {
amountDayMonth = 31;
} else if (month == 4 || month == 6 || month == 9 || month == 11) {
amountDayMonth = 30;
} else if(month == 2) {
amountDayMonth = 28;
}
return amountDayMonth;
}
Thanks!