Skip to content

Commit 2fc7cb2

Browse files
committed
minor fixes
1 parent 3dbe9d1 commit 2fc7cb2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

1-js/13-modules/01-modules-intro/article.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,14 @@ import {admin} from './admin.js';
175175
alert(admin.name); // Pete
176176

177177
*!*
178-
// Both 1.js and 2.js imported the same object
178+
// Both 1.js and 2.js reference the same admin object
179179
// Changes made in 1.js are visible in 2.js
180180
*/!*
181181
```
182182

183-
So, let's reiterate -- 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.
183+
As you can see, when `1.js` changes the `name` property in the imported `admin`, then `2.js` can see the new `admin.name`.
184+
185+
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.
184186

185187
Such behavior allows us to *configure* modules on first import. We can setup its properties once, and then in further imports it's ready.
186188

0 commit comments

Comments
 (0)