# Export by default in JavaScript

Only one value can be exported from an ES module. This is done with the `export default` command. When exporting using this command, it is the imported value that will get into the variable when importing a module.

Let's look at examples. We export one function:

`export default function() { return 'text'; };`

Let's do the import:

`import test from './test.js';`

We check the function:

`let res = test(); console.log(res);`

Create a module that exports a single function.

← →
↑
en ru