0
0
Javascriptprogramming~5 mins

JavaScript runtime overview - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a JavaScript runtime?
A JavaScript runtime is an environment where JavaScript code runs. It provides tools like memory management, event handling, and APIs to interact with the system or browser.
Click to reveal answer
beginner
Name two popular JavaScript runtimes.
Two popular JavaScript runtimes are the browser (like Chrome's V8 engine) and Node.js, which runs JavaScript outside the browser.
Click to reveal answer
intermediate
What role does the event loop play in the JavaScript runtime?
The event loop manages asynchronous tasks by checking the message queue and executing callbacks when the call stack is empty, allowing non-blocking code execution.
Click to reveal answer
beginner
What is the call stack in a JavaScript runtime?
The call stack keeps track of function calls. It follows last-in, first-out order, running the top function and removing it when done before moving to the next.
Click to reveal answer
intermediate
How does Node.js differ from browser JavaScript runtime?
Node.js provides extra APIs for file system, networking, and more, allowing JavaScript to run on servers, while browsers focus on web page interaction and DOM manipulation.
Click to reveal answer
What does the JavaScript event loop do?
AManages asynchronous tasks and executes callbacks
BCompiles JavaScript code to machine code
CStores variables and functions
DHandles user interface rendering
Which of these is NOT a JavaScript runtime?
AChrome browser
BPython interpreter
CNode.js
DV8 engine
Where does JavaScript run in a browser?
AIn the operating system kernel
BIn the call stack only
COn the server only
DInside the JavaScript runtime environment
What is the call stack used for?
AManaging asynchronous events
BStoring global variables
CTracking function calls in order
DRendering HTML elements
Which API is available in Node.js but NOT in browsers?
AFile system access
BsetTimeout
CDOM manipulation
Dconsole.log
Explain the main components of a JavaScript runtime and how they work together.
Think about how JavaScript runs code and handles tasks that take time.
You got /4 concepts.
    Describe the differences between running JavaScript in a browser and in Node.js.
    Consider what each environment allows JavaScript to do.
    You got /4 concepts.