revive let blocks

Kyle Simpson getify at gmail.com
Thu Jun 18 12:34:28 UTC 2015


> (function (a, b, c) {
> 
> }(2))

The main disadvantage of that style over the one I'm advocating for is that it visually separates the variable declaration (`a`) from its value initialization (`2`). If there's 5, 10, or more lines of code in between them, it makes it much harder to figure out the initial state of variables as they enter a "block".

Also, obviously, a function call is more heavy weight (performance wise) than a block with scoped declarations.


More information about the es-discuss mailing list