Завершающий этап модуля: крошечная библиотека с экспортом основных функций и утилит.
Putting C3 together
You'll design a single inline module that demonstrates the export shape a real library ships:
- A default export — the main thing the library is about.
- A few named exports — secondary utilities.
- No side effects — nothing runs at import time; just declarations.
Then "consume" the library in the same module by simulating the import + usage flow.
Library design tip
When you ship a library, every named export is a commitment — once published, removing or renaming it is a breaking change. Default exports are easier to evolve (you control the importer's local name). Most libraries land on:
- Default = the main entry point.
- Named = a curated 3-10 utilities.
- Anything else stays internal.
The capstone
Build a tiny "format" library: default export is format (takes a Date, returns ISO string); named exports are formatDate (just YYYY-MM-DD) and formatTime (just HH:MM). Then consume all three and log them.
Зарегистрируйся чтобы кодить
Теория открыта всем. Интерактивный редактор, живой превью и проверка открываются с 7-дневным бесплатным trial — нужна карта, отмена в любое время.
Регистрация — бесплатный trial →Первые 10 уроков в каждом треке — бесплатные. Карта не нужна.