You’ll rarely, if ever, need IIFEs with ES6, thanks to block-scoped function 
declarations and for-of (which creates a fresh copy of the iteration variable 
for each iteration).

Thus, instead of:

(function () {
    var tmp = …;
}());

you can do:

{
    let tmp = …;
}

I’d still love to have do-blocks, though.


On Jun 1, 2013, at 14:38 , Jorge <jo...@jorgechamorro.com> wrote:

> Hi,
> 
> How would this:
> 
> (Function () {
> 
>  // ...
> 
> })();
> 
> now look like with arrow functions?
> 
> (()=>{
> 
>  // ...
> 
> })();
> 
> What can be left out, if anything?
> 
> Thank you,
> -- 
> ( Jorge )();
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
> 

-- 
Dr. Axel Rauschmayer
a...@rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to