ЗавданняQuick recap. Inside a <script type='module'>: declare async function getOne() returning Promise.resolve(1) and async function getTwo() returning Promise.resolve(2). Then const [a, b] = await Promise.all([getOne(), getTwo()]). console.log a, b, and a+b.
Recap: Modules & async (C1-C3)
50 XP5 min
Теорія
Quick recap — Modules C1-C3
Modern syntax + the module system. The 4 pieces you write every day:
- `async function` + `await` — the only sane way to write fetch / DB / file IO.
- `Promise.all([a, b])` — fire two independent promises in parallel; await both.
- `<script type="module">` — opt in to ES modules in the browser. Top-level await works here.
- `fetch(url).then(r => r.json())` — the universal HTTP shape.
awaitmakes it linear.
If any feels random, redo C1-06 / C2-08 / C3-02 / C3-09 then come back.
🔒
Зареєструйся щоб кодувати
Теорія відкрита всім. Інтерактивний редактор, живий перегляд і перевірка відкриваються з 7-денним безкоштовним trial — потрібна картка, скасування у будь-який час.
Реєстрація — безкоштовний trial →Перші 10 уроків у кожному треку — безкоштовні. Картка не потрібна.