Why avoid 'var'?
The old var keyword is "function scoped" and allows "hoisting," which often leads to bugs where variables are accessible before they are defined or leak out of if statements.
Use 'const' for:
- API URLs
- Fixed Configuration
- Imported Modules
- Functions
Use 'let' for:
- Loop Iterators (i++)
- Toggles (true/false)
- Calculated Totals