The var declaration determines a variable’s life for the enclosing function. For block scopes in loops and conditionals, variable declarations are still part of the function scope, contrary to just about every other programming language in wide use. This was clearly a poor design choice that Brendan Eich made, and for anyone who isn’t blinded by loyalty, the let declaration is obviously an attempt to fix the design.

Your argument about keywords for statically typed languages is quite absurd. Of course, if you’re going to add types to a language, you need to distinguish among the different types with keywords. Duh! In dynamic languages (such as Smalltalk and Python and JavaScript), such keywords are unnecessary. So your point is an even greater non sequitur.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store