[Go to site: main page, start]

0% found this document useful (0 votes)
5 views1 page

Understanding JavaScript Modules

Uploaded by

sherrylruth04
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Understanding JavaScript Modules

Uploaded by

sherrylruth04
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

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 |
-----------------------------------------------------

You might also like