ES6 provides us with a new way to export and import in our files.
ES5 in Node we have module.exports and require()
We export our object our method using module.exports
And we import it by using require('/path/to/export');
In ES6
We import our code with 'import'
We export our code with "export default". According to the documentation, we we use default, 'there is only a single default export per module. A default export can be a function, a class, an object or anything else'.
We want to export more than one module in a file, we used named exports.
And we can import them by name
On the server it hasn't mattered that much if we imported a big module but on the frontend, we want to be as lightweight as possible. This is especially true since most people are using their phones to surf the web. In these cases we want to use named exports and imports only import what is essential to the frontend application.