Functions in ES6

Rick Waldron waldron.rick at gmail.com
Mon Mar 25 07:47:11 PDT 2013


On Mon, Mar 25, 2013 at 3:28 AM, Axel Rauschmayer <axel at rauschma.de> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130325/881cb257/attachment.html>


More information about the es-discuss mailing list