Use var, declare your vars global at the beginning of your script and document and track them well. Otherwise you are a lazy programmer. Nothing wrong with var.
Please NEVER follow this advice. What is described here is the height of laziness. Scope your variables appropriately, default to const and only use let where needed. Save yourself a ton of trouble. Don't be like this guy. Just don't.
30
u/zerik100 Oct 22 '21
tldr; never use var and if you think your code requires var then there's something wrong with your code