Arrow functions and return values

Jussi Kalliokoski jussi.kalliokoski at gmail.com
Thu Nov 29 10:09:28 PST 2012


On Thu, Nov 29, 2012 at 7:42 PM, Rick Waldron <waldron.rick at gmail.com>wrote:

>
>
>
> On Thu, Nov 29, 2012 at 9:41 AM, Brendan Eich <brendan at mozilla.org> wrote:
>
>> 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.
>
>
Oh, I hadn't realized this! In that case, great!

Cheers,
Jussi


>
> Sorry for the echo :(
>
>
>>
>>
>> /be
>>
>> ______________________________**_________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss>
>>
>
>
> _______________________________________________
> 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/20121129/6fda8466/attachment-0001.html>


More information about the es-discuss mailing list