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?
✗ Incorrect
The event loop manages asynchronous tasks by executing callbacks when the call stack is empty.
Which of these is NOT a JavaScript runtime?
✗ Incorrect
Python interpreter is not a JavaScript runtime; it runs Python code.
Where does JavaScript run in a browser?
✗ Incorrect
JavaScript runs inside the browser's runtime environment, which includes the engine and APIs.
What is the call stack used for?
✗ Incorrect
The call stack tracks function calls in last-in, first-out order.
Which API is available in Node.js but NOT in browsers?
✗ Incorrect
File system access is available in Node.js but not in browsers.
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.