Learn JavaScript

Lesson 3 of 9 · Async 1: Callbacks and the Event Loop

Module 12 · Async 1: Callbacks and the Event Loop

Full Programs with Callbacks: a Countdown, a Debounce, a Scheduler, Callback Hell and a Job Pool

Free with an accountReading

Sumon runs the tech side of a small online shop. This week he needs a flash-sale countdown and a search box that waits for a pause in typing. He also needs a nightly job list, some file reads, and a downloader that opens at most three connections. None of it needs a new idea. Every one of them is timers and callbacks, put together with care.

Checking what this lesson needs for you…

What is inside Full Programs with Callbacks: a Countdown, a Debounce, a Scheduler, Callback Hell and a Job Pool

  1. A countdown with setInterval
  2. A debounce with real timers
  3. A scheduler, and why timers run late
  4. A fake file read in the error-first shape
  5. Callback hell, shown honestly
  6. A job pool with a limit
  7. A tiny event loop of your own