Organising bigger programs
As programs grow, two tools keep them tidy: modules split code into separate files, and classes are blueprints for making many similar objects.
Modules: export and import
A module is a file that shares some of its code with export. Other files bring it in with import.
// file: money.js
export function addTax(amount) {
return amount * 1.13;
}
// file: app.js
import { addTax } from "./money.js";
console.log(addTax(100));