Shorter syntax for arrow function assignment

Brian Blakely anewpage.media at gmail.com
Tue Oct 24 17:19:14 UTC 2017


>Also, you cannot implicitly omit the "const"

Paving a cowpath, const has won named function assignment.

On Tue, Oct 24, 2017 at 1:16 PM, dante federici <c.dante.federici at gmail.com>
wrote:

> My major concern is this can be confusing with the "this" binding.
> The object wrapping being the only difference between:
> ```
> // Existing:
> const x = {
>   myFn() { }
> };
>
> // Proposed, with different meaning:
> const myFn() { } // Why would "this" bind to myFn?
> ```
> Omitting the arrow is a major -1 for me -- the whole point of "=>" is that
> it does not provide a "this" to the scope of the function body.
>
> Also, you cannot implicitly omit the "const", as these are all valid:
> ```
> export var symbol = ...
> export let symbol = ...
> export const symbol = ...
> ```
>
> _______________________________________________
> 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/007a0230/attachment.html>


More information about the es-discuss mailing list