IIAFEs?

Axel Rauschmayer axel at rauschma.de
Sat Jun 1 14:49:46 PDT 2013


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 <jorge at 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 at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
> 

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130601/4a25944b/attachment.html>


More information about the es-discuss mailing list