A rough guide for migrating functions from ES5 to ES6 would be:

1. Function declarations --> function declarations
2. Function expressions --> arrow functions
3. IIFEs -->  blocks
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).

Axel

-- 
Dr. Axel Rauschmayer
[email protected]

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

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

Reply via email to