JavaScript Senior
How are heaps related to JavaScript?
Select the correct answer
Heaps in JavaScript are a type of function.
Heaps in JavaScript are used to manage browser cookies.
Heaps in JavaScript are related to memory allocation.
Heaps in JavaScript are used to style HTML elements.
What is a generator function?
Select the correct answer
A generator function is a function that only works with arrays.
A generator function is a function that always returns a promise.
A generator function is a function that can pause and resume its execution.
A generator function is a function that can only be used in synchronous code.
What is the difference between reflow and repaint?
Select the correct answer
Reflow and repaint are the same process.
Reflow is the process of calculating the layout of a webpage, while repaint is the process of updating the visual appearance.
Repaint is the process of calculating the layout of a webpage, while reflow is the process of updating the visual appearance.
Reflow and repaint are used only in backend development.
Why is JavaScript treated as single-threaded?
Select the correct answer
JavaScript is treated as single-threaded because it executes one piece of code at a time.
JavaScript is treated as single-threaded because it can only run on single-core processors.
JavaScript is treated as single-threaded because it is used only for styling.
JavaScript is treated as single-threaded because it can only be used on servers.
What Is Obfuscation in JavaScript?
Select the correct answer
Obfuscation in JavaScript is the practice of making code difficult to understand.
Obfuscation in JavaScript is the practice of compiling code.
Obfuscation in JavaScript is the practice of making code easier to read.
Obfuscation in JavaScript is the practice of styling HTML elements.
What is a Temporal Dead Zone?
Select the correct answer
A Temporal Dead Zone is the time between variable declaration and variable assignment.
A Temporal Dead Zone is the time between variable assignment and variable declaration.
A Temporal Dead Zone is the time between scope exit and variable declaration.
A Temporal Dead Zone is the time between entering a scope and when the variable is declared.
Explain hoisting.
Select the correct answer
Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope.
Hoisting is a JavaScript mechanism for styling HTML elements.
Hoisting is a server-side technique.
Hoisting is a JavaScript mechanism for managing browser cookies.
What is event delegation in JavaScript?
Select the correct answer
Event delegation is a technique for handling events where a single event listener is added to a parent element.
Event delegation is a method to stop event propagation.
Event delegation is used to style HTML elements.
Event delegation is a server-side technique.