Read these in order. Each one assumes the ones before it. About an hour in total; stop after any step.
- Call stack: how a program remembers where it is.
- Thread: one line of execution, and why JavaScript has one for your code.
- Concurrency vs parallelism: doing many things at once without doing them at the same instant.
- Event loop: the rule that decides what runs next.
- Task queue and Microtask queue: the two lines callbacks wait in, and why one always goes first.
- Promise and async / await: the tools you actually write, and what they do to the queues.
- 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.