Kevin Smith zenparsing at
Tue Jun 24 19:48:07 PDT 2014

> Side note: is that legal?  I assumed you wouldn't be able to do that due
> to default being a reserved word.
Definitely.  Exports can be named any IdentifierName, so all of this is

    export { foo as class, bar as switch, baz as default };

And you can import IdentifierNames as well:

    import { class as foo, switch as bar, default as baz } from "wherever";

**Here's the crucial point:**

In fact, the default export is nothing other than an export named
"default".  These two import declarations are *entirely* equivalent:

    import { default as whatever } from "module";
    import whatever from "module";

Does that make sense?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list