Horje
What are ES6 Modules?

The ES6 modules can help us to modularize our code by dividing the code into different modules(JavaScript files) and importing them into different files using the import statement wherever we need them. The module files can be saved using the .mjs extension to show that it is a JavaScript module. To import a module, you first need to export it using the export statement. There are two ways available in JavaScript to export a module.

  • default export: It allows you to import a module using any name of your choice.
  • named export: You can import a module using its name only. Otherwise, it will not be imported.



Reffered: https://www.geeksforgeeks.org


JavaScript

Related
What is the use of the Event.preventDefault() method in Event Handling in JavaScript ? What is the use of the Event.preventDefault() method in Event Handling in JavaScript ?
What is the use of the Array.some() method in JavaScript ? What is the use of the Array.some() method in JavaScript ?
What is the use of the String.trim() Method in JavaScript ? What is the use of the String.trim() Method in JavaScript ?
What are the Advantages of Using Modules in JavaScript ? What are the Advantages of Using Modules in JavaScript ?
Explain Different Types of Scopes in JavaScript ? Explain Different Types of Scopes in JavaScript ?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
14