Modules in JavaScript:
----------------------
-> A module is a function or a group of similar functions.
-> They are grouped together within a file.
-> You create modules to better organize and structure your code.
-> You can use them to break down larger programs to smaller.
-> More manageable.
-> More independent chunks of code which carry out a single or a couple of related
tasks.
-> Javascript modules allow you to break upp your code into separate files.
-> There are two types of exports: Named exports and Default exports.
-> Modules are imported from external files with the import statements.
-> Modules only work with the HTTP(s) protocol.
-> Independent\Self-contained: A module has to be as detached from other
dependencies as possible.
-> Specific: A module needs to be able to perfom a single or a related group of
tasks.
The core essence of creatinf them in the first place is to create separaate
functionalities.
One module, One(kind of) task.
-> Reusable: A module has to be easy to integrate into various kinds of programs to
perfom its task.
-> Modules within functions or variables can be stored in any external file.
-----------------------------------------------------
Module: |
=> a function |
=> group of functions |
=> separate file |
=> independent chunks |
=> specific tasks |
=> manageable(Organize the code and structure) |
=> variable and function |
=> HTTP protocol |
-----------------------------------------------------