revive let blocks

Bradley Meck bradley.meck at gmail.com
Thu Jun 18 13:59:27 UTC 2015


(a=1)=>{
  console.log(a)
}()

Is less verbose than an IIFE and keeps `this` the same. Also keeps the
initialization and init of the variable in the same place.

On Thu, Jun 18, 2015 at 8:54 AM, Boris Zbarsky <bzbarsky at mit.edu> wrote:

> On 6/18/15 9:01 AM, Kyle Simpson wrote:
>
>> In addition to the fact that this feature is long since co-existing in FF
>> and doesn't seem to have broken the web
>>
>
> Firefox doesn't ship let support on the web by default yet.  For example,
> this HTML:
>
> <script>let x = 5;</script>
>
> will result in:
>
>   SyntaxError: missing ; before statement
>
> at the location of the 'x'.
>
> You have to explicitly opt in to let support in Firefox right now via
> language="javascript1.8" or similar.
>
> That's not to say this change would break the web; just that we have no
> evidence it doesn't.
>
> -Boris
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150618/b3562fce/attachment.html>


More information about the es-discuss mailing list