You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it intentional that the following fails to compile?
letx=5;{console.log(x);// Block-scoped variable 'x' used before its declarationletx=x;// Block-scoped variable 'x' used before its declarationconsole.log(x);}
The inner x is effectively shadowing the outer x, but only at and after the point it is redefined (i.e. the inner let x)
I couldn't find any specific mention of this in #904 which appears to be the documentation for let right now (via the spec)