The drawbacks of var
The critical drawbacks of var
- var only gets its own scope when it's declared inside a function.
- Declaring a variable with var allows duplicate declarations.
- It's the same as declaring a variable without a declaration statement.
- Let's not use var!! Use let when you need to reassign, and const when you don't!
- #const
- #let
- #var
- #Drawbacks of var