JS Built-ins
Modulesbeginner

Named Exports

In ES modules, named exports let you export multiple values from a file: export const PI = 3.14; and export function add(a, b) { return a + b; }. Consumers import them by name: import { PI, add } from './math';. In this sandbox, simulate a module using an object that represents the module's public API.

πŸ’‘ Hints (3)
  • β€’ Return an object with properties PI and add
  • β€’ PI should be 3.14159
  • β€’ add should be a function that takes two numbers and returns their sum