Merge pull request #2881 from leviding/patch-42
fix error in 1-js/13-modules/01-modules-intro/article.md
This commit is contained in:
commit
883bd606d7
1 changed files with 1 additions and 1 deletions
|
@ -182,7 +182,7 @@ alert(admin.name); // Pete
|
|||
|
||||
As you can see, when `1.js` changes the `name` property in the imported `admin`, then `2.js` can see the new `admin.name`.
|
||||
|
||||
That's exactly because the module is executed only once. Exports are generated, and then they are shared between importers, so if something changes the `admin` object, other modules will see that.
|
||||
That's exactly because the module is executed only once. Exports are generated, and then they are shared between importers, so if something changes the `admin` object, other importers will see that.
|
||||
|
||||
**Such behavior is actually very convenient, because it allows us to *configure* modules.**
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue