OneCompiler

JavaScript program to print Present Year

256

Below program shows you how to print current year.
We can get Current Year using new Date().getFullYear() in Javascript.

function getFullYear() {
  var year = new Date().getFullYear();
  console.log(year);
}

getFullYear();

Output:

 2021

Try it Online here https://onecompiler.com/javascript/3x5qav87u