Skip to content
var기술 정리

The drawbacks of var

1 min readTech notesMoved from my Tistory blogRead the Korean original

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

More in Tech notes