restrictions on let declarations

Thaddee Tyl thaddee.tyl at gmail.com
Thu Jan 30 17:38:26 PST 2014


On Thu, Jan 30, 2014 at 8:27 PM, John Lenz <concavelenz at gmail.com> wrote:
> I don't argue that it isn't a useless "let".

For the sake of argument, can you construct a non-block-scoped `if (…)
…` which is actually any useful, assuming your mental model of

    if (…) … <==> if (…) { … }

(which must be removed from teaching material) applies?

By the way, even in the current specification of let, we can still
construct a useless let:

    for (let x = 42;false;) console.log(x);

(which is the same as the example you gave, using "if").


More information about the es-discuss mailing list