Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (9.5k points)

Can anyone tell me how to get the current year in JavaScript? 

1 Answer

0 votes
by (19.7k points)

You can use getFullYear() by calling it with the object new Date() like below: 

// returns the current year

new Date().getFullYear()

Interested in Java? Check out this Java tutorial by Intellipaat.   

Related questions

0 votes
1 answer
asked Feb 16, 2021 in Web Technology by Jake (7k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories

...