Home / Javascript Tips Generated By ChatGPT / Using Modules to Organize Code in Javascript Modules allow you to split your code into separate files. Source Code // In module.js export function sayHello(name) { console.log(`Hello, ${name}!`); } // In main.js import { sayHello } from './module.js'; sayHello('John');