The main problem with printing the current year on a website is that it can be difficult to read.
This code line writes the current year to the document.
A variable can be defined using the var keyword, and it will automatically have a scope that is limited to the current block of code. You can also define variables using the var keyword, but you can also define them using the let keyword. The let keyword allows you to define a variable outside of any block of code, which makes it more versatile.
You can also use the var keyword to create global variables, which are available to all scripts on your page. Global variables are not limited by any scope, so they can be used anywhere in your code.
Main variables types