Next →

JavaScript Modules

Modules help organize code by splitting it into separate files, each with its own scope.

Exporting

Use export to make variables, functions, or classes available to other modules.

// math.js
export function add(a, b) {
  return a + b;
}

Importing

Use import to include exported features from another module.

// main.js
import { add } from './math.js';
console.log(add(2, 3)); // 5

Modules allow you to keep code clean, reusable, and maintainable.
Currently there is an issue when creating an export in our app, sorry for this inconvenience!