JS Built-ins
Modulesbeginner

Re-exporting

Modules can re-export from other modules: export { add } from './math'; or export * from './utils';. This creates a barrel file that aggregates exports. Simulate by composing two module objects into one.

πŸ’‘ Hints (3)
  • β€’ Use the spread operator (...) to combine objects
  • β€’ Call createMathModule() and createStringModule() inside createBarrelModule
  • β€’ Spread both module objects into the returned object