This question has already been answered:
Studying variables in js stumbled upon an interesting thing, namely here
let a = 10; (function(){ console.log(a); let a = 100; console.log(a); })(); If this is run through the transcompiler, then the first console will display undefined and it will be correct, because the ascent of the variable will work. If we run this code without a transcompiler, we get the error Uncaught ReferenceError: a is not defined
This is where the question arises, why does an error occur without a transcompiler because we have access to a variable from the outside? Explain this inaudibility.
PS Variable as well as functions float, but does let variable pop up? Different sources write differently, "someone pops up, someone doesn't" ... it's not clear ... So does it pop up? And how does the let variable work?
