function getMonthName(monthNumber) {
const date = new Date();
date.setMonth(monthNumber - 1);
return date.toLocaleString([], { month: 'long' });
}
Post funny things about programming here! (Or just rant about your favourite programming language.)
Oh, because if the month you chose has less than 31 days, it’ll assume the 31st of September is the 1st of October? That’s reasonable.