Advantages of Modules
There are two types of modules can be defined in ECMAScript 2015
In this single module is declared for export functionality. Modules need to be declared with an export keyword to make use of it in another part of the code. Import keyword is used to import the modules Here is a syntax for import and export Default module declaration.
export default ModuleName // Export is declared with export keyword
Once the module is exported, It is ready to use in other modules using import keyword. Here is a syntax for import keyword
import ModuleName from 'filepath without extension'