Last updated on Jul 6, 2022 by Suraj Sharma
getFullYear() method available in the
Date object. It returns the year in
const date = new Date() currentYear = date.getFullYear() console.log(currentYear) // "2022"
Rate this post
Suraj Sharma is a Full Stack Software Engineer. He holds a B.Tech degree in Computer Science & Engineering from NIT Rourkela.