If a company was registered in a particular year, I want to be able to show the company's year registered through to the current year. for example if a company was registered in let's say 2018; i want to be able to have something like 2018, 2019, 2020, 2021. So i have a function that is able to get only the current year. So want a way i can achieve this.
This is a function i have which works fine because it gives me the current year.
getLastYear() {
const now = new Date();
const currentYear = now.getFullYear();
return currentYear - 1;
}