revive let blocks

Herby Vojčík herby at mailbox.sk
Thu Jun 18 13:39:56 UTC 2015



Benjamin Gruenbaum wrote:
>  > From: Kyle Simpson <getify at gmail.com <mailto:getify at gmail.com>>
> To: "es-discuss at mozilla.org <mailto:es-discuss at mozilla.org>"
> <es-discuss at mozilla.org <mailto:es-discuss at mozilla.org>>
> Cc:
> Date: Thu, 18 Jun 2015 07:34:28 -0500
> Subject: Re: revive let blocks
>  > > (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 that's the problem you can do
> ```js
> ((a = 2, b, c) => {
>
> })();
> ```

Well, I personally think this example is good enough and engines surely 
optimize already (IIFE is here long enough so that it is optimized).

> And engines can optimize - but I can see the merit of explicit syntax
> for this.



More information about the es-discuss mailing list