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.