The following code will output "1." However, shouldn't the keyword "let" not make x a global variable, thus making it invisible to das()? let is supposed to limit the scope of variables to only the block where they're declared, yet here, I'm seeing an inner function have access to a "let" variable, even though x was declared outside its scope. How is that possible?
function letTest() {
function das () {
console.log(x);
// How does this function have access to a let variable declared outside its scope?
}
let x = 1;
das();
}
letTest();