I want a function that gives the full name of prev month for any given month[not just current month]
Ex: prevMonth(August) = July; prevMonth(January)= December
.
I'm new to js and can't figure out how to use this array to get the result:
monthsarray: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]