Understanding ES Modules (ESM)
Named Exports
You can have multiple named exports per file. When importing them, you must use the exact name inside curly braces.
export const pi = 3.14;
Default Exports
Each file can have only one default export. This is useful for exporting a main class or function.
export default function multiply(a, b) { return a * b }