Modules, introduction thumbnail
Modules, introduction
javascript.info
A module is just a file. One script is one module. As simple as that. Modules always work in strict mode. E.g. assigning to an undeclared variable will give an error. Each module has its own top-level scope. If the same module is imported into multiple other modules, its code is executed only once,
7 Users
0 Comments
139 Highlights
0 Notes

Top Highlights

  • A module is just a file. One script is one module. As simple as that.
  • Modules always work in strict mode. E.g. assigning to an undeclared variable will give an error.
  • Each module has its own top-level scope.
  • If the same module is imported into multiple other modules, its code is executed only once, upon the first import. Then its exports are given to all further importers.
  • so if something changes the admin object, other importers will see that.

Tags

Javascript

Ready to highlight and find good content?

Glasp is a social web highlighter that people can highlight and organize quotes and thoughts from the web, and access other like-minded people’s learning.