Understanding the event loop

The TypeScript runtime (JavaScript) has a concurrency model based on an event loop. This model is quite different from the model in other languages, such as C or Java. Before we focus on the event loop itself, we must understand some runtime concepts.

What follows is a visual representation of some important runtime concepts: heap, stack, queue, and frame:

We will now look at the role of each of these concepts.

Get Learning TypeScript 2.x - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.