I am very new to programming, and I am enrolled in a coursera course for front-end dev. The first lesson was on how to declare a variable using "var". But other YouTube tutorials that I took before enrolling the course (Traversy Media) taught me to never use var, and only stick to let and const?
Is there something I need to learn or unlearn here?
In a perfect world, you would only use let or const but you live in a world where you will eventually see older code where that wasn't standard practice.
Long story short: for new code, use let or const but understand that you will almost certainly see var in your travels as a developer.
Using var is fine. Just be careful to not re-declare it at a wrong place. I'd get in the habit of using javascript a minimum amount. Use for lookup tables, modals, etc.