Previously, there was no native support for modules in JavaScript. ES6 introduced a new feature called modules, in which 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.