>
>
>On Monday, June 16, 2014 12:33 AM, Axel Rauschmayer <a...@rauschma.de> wrote:
>
>
>**Single-export modules.** Still missing is support for single-export modules,
>which could be added as follows (the keyword `default` instead of the asterisk
>works just as well, in my opinion).
You're being confused by CommonJS. ES6 modules don't have "single-export
modules". All modules can have multiple exports. And all modules can have a
specially named export called "default" which allows you to skip the curly
brackets.
Example:
// foo.js
export default function () { // anonymous function
console.log(42);
}
// bar.js
import answer from 'foo'; // I can give whatever name I want to the default
export
answer(); // 42
Juan
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss