js new date year code example
Example 1: how to get the year in javascript
new Date().getFullYear(); // This will get you the current year
Example 2: get year from date javascript
document.write(new Date().getFullYear());
new Date().getFullYear(); // This will get you the current year
document.write(new Date().getFullYear());