I am facing an issue where I need to retrieve all the months that have passed in 2020, such as January, February, March, April, May, June, July, and August, and store them in an array.
After executing the code below, my variable 'month' returns the number 7, indicating it is currently August. Now, I want to add numbers 7, 6, 5, 4, 3, 2, 1, and 0 to an array. How can I achieve this?
const d = new Date();
const month = d.getMonth();
Since I am still new to typescript, I would appreciate any assistance on how to accomplish this task. Thank you in advance for your help.