To get the current year in JavaScript, do this:
new Date().getFullYear().Here's how you do it:
const year = new Date().getFullYear();
console.log(year); // 2022

new Date().getFullYear().Here's how you do it:
const year = new Date().getFullYear();
console.log(year); // 2022