To get the current year, we would first have to create a new date object.
This new date object would give us the current date of client.
Using this current date, we will get the year value by usnig the getFullYear method available on the date object.
Let's see this in an example.
In the last example, we saw how we could get the current year from the current date.
In the following example, we will learn that because the method .getFullYear() is on the date object, you can pass in a date of your choice.