JS Built-ins
Modulesbeginner

Default Export

A module can have one default export: export default function greet(name) { ... }. Consumers import it without braces: import greet from './greet';. The imported name can be anything. Simulate a default export as a factory function returning the main export.

πŸ’‘ Hints (3)
  • β€’ Return a function from createGreetModule
  • β€’ The function should accept a name parameter
  • β€’ Return a string in the format "Hello, {name}!"