Which HTTP status code range generally indicates a successful request made with the Fetch API?
200-299
300-399
100-199
400-499
What does the await keyword do inside an asynchronous function?
await
It pauses execution until the Promise it's used with resolves or rejects.
It logs an error message to the console.
It sets a timeout before executing the next line of code.
It defines a new Promise object.
Which of the following is NOT a valid HTTP method used with the Fetch API?
GET
POST
CONNECT
DELETE
In the context of higher-order functions, what does it mean for a function to be passed as an argument to another function?
The function is executed before being passed as an argument.
The function's code is copied into the receiving function.
The function's return value is passed as the argument.
A reference to the function is passed, allowing it to be invoked later.
What is a key difference between 'async/await' and traditional Promise-based code?
'async/await' doesn't use Promises internally.
'async/await' provides a more synchronous-looking syntax for asynchronous code.
'async/await' is suitable for handling synchronous operations only.
'async/await' is significantly slower than using Promises directly.
Which technique can minimize DOM reflows and repaints, leading to smoother UI updates?
Making changes to elements with 'display: none'
Frequently reading element properties like 'offsetWidth'
Using 'innerHTML' to update large sections of the DOM
Batching DOM updates and using 'requestAnimationFrame'
In the context of ES6 classes, what is the purpose of the 'extends' keyword?
It extends the functionality of a built-in JavaScript object like Array or String.
It defines a new static method within a class.
It's used to create an instance of a parent class.
It establishes inheritance by creating a subclass that inherits properties and methods from a superclass.
In JavaScript's event loop, what is the role of the 'microtask queue'?
It manages network requests and responses.
It handles user interactions like clicks and scrolls.
It executes tasks that have been explicitly delayed with setTimeout.
It processes promises and other tasks with higher priority than the main task queue.
What is a primary method for avoiding memory leaks in JavaScript?
Using 'const' for all variable declarations
Using 'async/await' for all asynchronous operations
Dereferencing unused objects and variables
Minimizing function calls
Consider the code: const myFunc = (a, b) => a + b;. What type of function is myFunc?
const myFunc = (a, b) => a + b;
myFunc
Method
Generator function
Constructor function
Arrow function