FYI, a single line to get the number of days in a month. new Date(year, month+1, 0).getDate(); where month represents a zero-indexed value for the month (January === 0, same as you are expecting above).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
FYI, a single line to get the number of days in a month. new Date(year, month+1, 0).getDate(); where month represents a zero-indexed value for the month (January === 0, same as you are expecting above).