Shorter syntax for arrow function assignment

/#!/JoePea joe at trusktr.io
Tue Oct 24 20:38:36 UTC 2017


It doesn't matter if `function`s are being used less, they simply
aren't going away. There's plenty of people specifically relying on
`function` for certain purposes where arrow functions do not work.
Lets avoid getting arrows confused with functions.

```js
const prototype = /* ... get this prototype object from somewhere ... */

prototype.foo = function foo() {
  // do something with `this`.
}
```

That sort of stuff (relying on non-arrows) isn't going away.
/#!/JoePea


On Tue, Oct 24, 2017 at 1:12 PM, Brian Blakely <anewpage.media at gmail.com> wrote:
> To be clear, this isn't a proposal to drop support for something.  Don't
> optimize for a fading use-case, however.
>
>>it doesn't seem to add anything other than "I don't like typing '='".
>
> That is absolutely correct, it is a proposal for shorthand syntax.
>
>
> On Tue, Oct 24, 2017 at 4:08 PM, dante federici <c.dante.federici at gmail.com>
> wrote:
>>
>> The use case fading away doesn't mean you can drop support for it, or that
>> it won't still be in use.
>>
>> Please stop trying to push your "shorthand" syntax of:
>> ```
>> myFn() {
>> }
>> ```
>>
>> It's already been pointed out in multiple cases that:
>> 1. The current usages are not "outmoded"
>> 2. The proposed syntax has misleading `this` binding without the arrow
>> 3. Blocks, ASI, and the object shorthand notation either conflict or make
>> it vague how to interpret
>>
>> This isn't a beneficial syntax moving forward, and it doesn't seem to add
>> anything other than "I don't like typing '='".
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>>
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>


More information about the es-discuss mailing list