Snippet:
months = [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December'
];
currentMonth: String;
this.currentMonth = this.months[date.getMonth()];
nextMonth() {
this.currentMonth = ...
}
How can I implement the nextMonth function to update the value of currentMonth? For instance, if its current value is 'August', what logic should I incorporate in my function so that it increments its value by 1, resulting in 'September'?