how to get the year in javascript

JavaScript
new Date().getFullYear(); // This will get you the current year
Source

Also in JavaScript: