var foo = "abc";
function do ( foo ) { foo = "def"; console.log( foo );
let foo = "bar";
console.log( foo );
var foo = "baz";
console.log( foo );
}
console.log( foo );
do( foo );
console.log( foo );And of course var has to be around for backwards compatibility, but if the addition of let is being made to make variable declaration more intuitive or simpler then it is failing because var must be included. You cannot consider let in isolation and when considered in combination with var, it makes things more complicated.