Arrow functions and return values

Brendan Eich brendan at mozilla.org
Thu Nov 29 09:41:03 PST 2012


Kevin Smith wrote:
>
>     It's a bit unclear to me how arrow functions react to semicolons,
>     for example:
>
>     var a = (c) => {
>       var b = 2;
>       b * c;
>     }
>
>     a(4);
>
>
> Hmmm...  I was under the impression that arrow functions with normal 
> function bodies do *not* implicitly return anything.  Maybe I need to 
> adjust my spec goggles, but I don't see that in the latest draft.

Oh (and d'oh!) you are quite right. There's no implicit return or other 
TCP aspect save lexical-|this|, at all.

/be


More information about the es-discuss mailing list