On Mon, Mar 25, 2013 at 3:28 AM, Axel Rauschmayer <[email protected]> wrote:

> A rough guide for migrating functions from ES5 to ES6 would be:
>
> 1. Function declarations --> function declarations
>
2. Function expressions --> arrow functions
>

Claude nailed this one


> 3. IIFEs -->  blocks
>

or Modules


> 4. Functions in object literals --> concise method syntax
> 5. Constructors --> classes
> 6. New: generator functions
>
> These rules are easy to understand, with one exception: You can’t have a
> function declaration with lexical |this| (that is, #1 is a potential source
> of confusion).
>
> Have there been ideas for this? I’m thinking arrow function declarations
> (but without syntactic expression-versus-declaration ambiguity).
>

What do you mean by arrow function declarations?

Rick
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to