Some tips:
Get in the habit of using “let” instead of “var.” Why? Mostly for convenience, and there’s no reason not to do it even if you don’t do anything with it. “Let” essentially lets you have two different variables with the same name. This is very useful in those pesky nested for loops, and for when you can’t think of a name for a variable. There is a very nice guide for using “let” on W3Schools.
If it exists, it can be put in a variable. Did you know you can put functions inside variables? JavaScript does not care what you put in there.
I would highly recommend you learn about objects. They are incredibly helpful with organizing your variables and functions, and you are forced to deal with them often just because of how JavaScript works with html. This is something that can get confusing very quickly if you don’t understand it.