How to get ‘how many days in February’ using Javascript?
It is quite handy to have a function that can tell you how many days there are in February due to the leap year shift of either 28 or 29 days.
Below is a function created in Javascript to return the exact amount of days according to the year given: