In JavaScript, modules are a way to break up your code into separate files. This makes your code more organized, maintainable, reusable and easier to debug. Previously, there was no native support for modules in JavaScript. introduced in ES6 each module is represented by a separate '.js' file. We can use the 'import' or 'export' statement in a module to import or export variables, functions, classes or any other component from/to different files and modules.