> 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
valid:
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?
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss