do while scope

Caitlin Potter caitpotter88 at gmail.com
Fri Apr 17 15:10:41 UTC 2015


Is there a language where lexically scoped variables declared in a block are accessible outside of that block? Java, C, C#, rust, Python, etc, will not let you do this. I’m not sure this is a gotcha for most software developers

> On Apr 17, 2015, at 10:57 AM, Glen Huang <curvedmark at gmail.com> wrote:
> 
> ```js
> do {
>  let a = 1;
> } while (a);
> ```
> is "a" undefined in the while condition? This seems like a gotcha.
> 
> 
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss



More information about the es-discuss mailing list