One Pager Cheat Sheet
- A
JavaScript engine
reads, translates and executes code and is embedded inJavaScript runtime environments
such as browsers,Node.js
orJRE
. - No, this statement is false: the JavaScript engine's
execution
of the code is the final stage that actuallyruns
it. - The JavaScript Engine works with a
Parser
, anAbstract Syntax Tree (AST)
, anInterpreter
, aProfiler
, aCompiler
, and optimized code, as well as aCall Stack
andMemory Heap
, to process code quickly and efficiently. - The Profiler
watches
the code andmakes optimizations
, improving the performance of the JavaScript Engine. - A runtime is a program that extends the JavaScript engine and provides additional functionalities, such as relevant
APIs
to interact with the outside world, so as to build JavaScript based software. - The JavaScript Runtime consists of Web APIs, the Callback queue, and the Event loop, which together enable JavaScript to run asynchronously by scheduling callbacks from the Web APIs to be added to the stack.
- The
Event Loop
monitors theCallstack
andCallback Queue
and allows asynchronous execution of callback functions by continuously pushing them onto theCallstack
. - The JavaScript Engine analyzes and prepares the code for execution, while the Runtime executes the code and manages the queues that are associated with code execution.
- No, the JavaScript Engine is responsible for
syntactic analysis
of the source code and creating a machine understandable code, while the Runtime is used for executing the code.