๐ฐmodule
JS โฉ module
Modules provide structure to bigger programs by separating the code into pieces with clear interfaces and dependencies.
interface๏ผ the part thatโs visible from other modules.
dependencies๏ผ other modules that it makes use of.
in Node.js, each JS file is treated as a module.
in a module there's no "module scope object" for these top-level declarations to be added to as property.
( ๐ compare๏ผ global var / function is global object propertyโ๏ธ)
Last updated
Was this helpful?