Shorter syntax for arrow function assignment

/#!/JoePea joe at trusktr.io
Tue Oct 24 16:54:01 UTC 2017


It can be confusing because it is too similar to non-arrow functions. The
arrow syntax is clear in meaning.

*/#!/*JoePea

On Tue, Oct 24, 2017 at 9:51 AM, Brian Blakely <anewpage.media at gmail.com>
wrote:

> This syntax is shorter, easier to write, and arguably easier to read.
> What else does it need to offer?
>
> On Tue, Oct 24, 2017 at 12:48 PM, kai zhu <kaizhu256 at gmail.com> wrote:
>
>> -1
>> this fails styleguide sanity-check.
>>
>> we currently have 3 common styles of declaring functions:
>> 1. foo = function () {...}
>> 2. function foo () {...}
>> 3. foo = () => {...}
>>
>> does this extra 4th style offer anything new to justify making the
>> javascript language even less consistent than it already is?  i say
>> no.
>>
>>
>> On 10/25/17, Brian Blakely <anewpage.media at gmail.com> wrote:
>> > A prevalent pattern has emerged:
>> >
>> > `export const foo = ()=> { };`
>> >
>> > Taking a cue from short method syntax, this comes to mind as a possible
>> > improvement:
>> >
>> > `export const foo() { };`
>> >
>> > Even better if we assume const:
>> >
>> > `export foo() { };`
>> >
>> > That is delicious.  Thoughts?
>> >
>>
>
>
> _______________________________________________
> 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/20171024/b7861385/attachment.html>


More information about the es-discuss mailing list