Read these in order. Each one assumes the ones before it. About an hour in total; stop after any step.

  1. Call stack: how a program remembers where it is.
  2. Thread: one line of execution, and why JavaScript has one for your code.
  3. Concurrency vs parallelism: doing many things at once without doing them at the same instant.
  4. Event loop: the rule that decides what runs next.
  5. Task queue and Microtask queue: the two lines callbacks wait in, and why one always goes first.
  6. Promise and async / await: the tools you actually write, and what they do to the queues.
  7. Web Worker: the way out when one thread is not enough.

Then test yourself: the JavaScript section of Practice, and the lesson #1 · The event loop.