revive let blocks

Kyle Simpson getify at
Sat Jun 20 13:10:26 UTC 2015

Just to wrap this thread up, quoting myself from another thread:

"In any case, I won't push my proposal anymore."


But for posterity sake, wanted to make one last comment as to why the various suggestions for IIFE's and arrow expressions are inappropriate for the task: they change (hijack) the behavior of `return`, `break`, and `continue`. A standalone block like `{ let x = 2; .. }` or `let (x = 2) { .. }` can be placed anywhere, inside a function, loop, etc, and not hijack these types of statements.

I'll be sticking with:

{ let x = 42;

    console.log("The meaning of JS: ", x);


Appreciate the various thoughtful responses.

More information about the es-discuss mailing list