minor fixes
This commit is contained in:
parent
1770074c5f
commit
3dbe9d13fb
1 changed files with 2 additions and 0 deletions
|
@ -146,6 +146,8 @@ import `./alert.js`; // Module is evaluated!
|
|||
import `./alert.js`; // (shows nothing)
|
||||
```
|
||||
|
||||
The second import shows nothing, because the module has already been evaluated.
|
||||
|
||||
There's a rule: top-level module code should be used for initialization, creation of module-specific internal data structures. If we need to make something callable multiple times - we should export it as a function, like we did with `sayHi` above.
|
||||
|
||||
Now, let's consider a deeper example.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue