What's the difference between using "let" and "var"?
Asked 07 September, 2021
Viewed 1K times
  • 57
Votes

ECMAScript 6 introduced the let statement.

I've heard that it's described as a local variable, but I'm still not quite sure how it behaves differently than the var keyword.

What are the differences?. When should let be used instead of var?

30 Answer