Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // exporter1.js
- let foo = 1;
- export { foo as default }; // exports the foo binding
- foo = 2;
- // exporter2.js
- let foo = 1;
- export default foo; // creates a new binding named *default* and initializes it to 1.
- foo = 2; // assigns to the foo binding which is not exported
- // importer1.js
- import foo from "exporter1.js";
- print(foo); // 2
- // importer2.js
- import foo from "exporter2.js";
- print(foo); // 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement