3

I know that the document, window, etc. objects are part of the runtime, and I know that the engine deals with things like JIT compilation, running the actual code, etc.

But where does the event-loop, callback queue, etc. lie? Is it in the runtime? The engine?

Adam Thompson
  • 3,278
  • 3
  • 22
  • 37
  • similar question asked and answered [here](https://stackoverflow.com/questions/29027845/what-is-the-difference-between-javascript-engine-and-javascript-runtime-environm) - though the only mention of the event loop states it is in the "host environment not the JS implementation" - guess you could read that whole answer to see what they mean by those terms and how they relate to runtime and engine :p – Jaromanda X Sep 10 '18 at 23:11
  • Possible duplicate of [Does V8 have an event loop?](https://stackoverflow.com/questions/50115031/does-v8-have-an-event-loop) – jmrk Sep 10 '18 at 23:32

1 Answers1

0

This answer is based on this article which describes in detail, the Javascript Engine, Runtime and the call Stack

The Engine consists of two main components: * Memory Heap — this is where the memory allocation happens * Call Stack — this is where your stack frames are as your code executes

enter image description here Event loop and callback queue are part of Javascript Runtime: enter image description here

user3885927
  • 3,363
  • 2
  • 22
  • 42