SyntaxStudy
Sign Up
JavaScript Intermediate 4 min read

Named Exports

Named Exports

Named exports let a module export multiple values. Use the export keyword before functions, classes, or variables.

Example
// math.js — multiple named exports

export const PI = 3.14159;

export function add(a, b) {
  return a + b;
}

export function multiply(a, b) {
  return a * b;
}

// Or export all at once at the bottom
const subtract = (a, b) => a - b;
export { subtract };
Pro Tip

Named exports are explicit about what a module provides — prefer them over default exports for modules with multiple utilities.