const d = new Date(); d.setFullYear(d.getFullYear()-1); console.log(d.toDateString()); // "Fri Oct 04 2019"
const currentYear = new Date().getFullYear(); // 2020 const previousYear = currentYear-1; console.log(previousYear); // 2019