| What is modules and how to use in Javascript
A module is just a file and we can say One script is one module. Modules are very small units of independent, reusable code that is used as building blocks in creating a non-trivial Javascript application. Modules can load each other by using special directives like export and import to interchange functionality. Which is used to call functions of one module from another one.
(1)export keyword variables functions and lables that is accessible from outside the current module.
(2)import allows the import of functionality from other modules.
Modules always use strict and code is executed only once. Exports are created once and shared between importers. | | |