Shorter syntax for arrow function assignment

dante federici c.dante.federici at gmail.com
Tue Oct 24 17:16:19 UTC 2017


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 = ...
```
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20171024/1a9b64c8/attachment.html>


More information about the es-discuss mailing list