Update article.md

This commit is contained in:
LeviDing 2022-02-16 09:11:59 +08:00 committed by GitHub
parent 29216730a8
commit 79a1b9293b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.**