const currentYear = new Date().getFullYear(); // 2020 const previousYear = currentYear-1; console.log(previousYear); // 2019