ECMAScript 6 introduced two new ways of declaring variables: the let
statement and the const
statement. How are they different from the var
keyword?
Asked
Active
Viewed 476 times
2

Michał Perłakowski
- 88,409
- 26
- 156
- 177
-
@JimStewart In what way is that Q&A better than mine? Questions should be closed as duplicate of questions which have better answers, and IMO my answer is much better. See [Should I flag a question as duplicate if it has received better answers?](http://meta.stackoverflow.com/q/251938/3853934) – Michał Perłakowski Nov 23 '16 at 23:47
-
1**Note**: this is an attempt to create a better canonical questions explaining the differences between "var", "let" and "const". Please don't close it as a duplicate of [What's the difference between using "let" and "var" to declare a variable?](http://stackoverflow.com/q/762011/3853934) before reading the Meta questions: [User refusing to correct misinformation in their popular answer](http://meta.stackoverflow.com/q/338376/3853934) and [Canonical question explaining differences between “var”, “let” and “const” in JavaScript](http://meta.stackoverflow.com/q/338663/3853934). – Michał Perłakowski Dec 02 '16 at 00:05