Wednesday, October 19, 2016

What is "export default" in JavaScript?

ES6 is the first time that JavaScript has built-in modules. ES6 modules are stored in files.

The "export" statement is used to export functions, objects or primitives from a given module(or file).

There are two types of export available:

  • Named export - useful to export several values from a given file.
  • Default export - there can only be a single default export from a given file. 
If a module defines a default export, then you can import the default export by omitting the curly braces.

Read more:

No comments:

Post a Comment