JavaScript Senior

1 / 8

How are heaps related to JavaScript?

Select the correct answer

1

Heaps in JavaScript are a type of function.

2

Heaps in JavaScript are used to manage browser cookies.

3

Heaps in JavaScript are related to memory allocation.

4

Heaps in JavaScript are used to style HTML elements.

What is a generator function?

Select the correct answer

1

A generator function is a function that only works with arrays.

2

A generator function is a function that always returns a promise.

3

A generator function is a function that can pause and resume its execution.

4

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

1

Reflow and repaint are the same process.

2

Reflow is the process of calculating the layout of a webpage, while repaint is the process of updating the visual appearance.

3

Repaint is the process of calculating the layout of a webpage, while reflow is the process of updating the visual appearance.

4

Reflow and repaint are used only in backend development.

Why is JavaScript treated as single-threaded?

Select the correct answer

1

JavaScript is treated as single-threaded because it executes one piece of code at a time.

2

JavaScript is treated as single-threaded because it can only run on single-core processors.

3

JavaScript is treated as single-threaded because it is used only for styling.

4

JavaScript is treated as single-threaded because it can only be used on servers.

What Is Obfuscation in JavaScript?

Select the correct answer

1

Obfuscation in JavaScript is the practice of making code difficult to understand.

2

Obfuscation in JavaScript is the practice of compiling code.

3

Obfuscation in JavaScript is the practice of making code easier to read.

4

Obfuscation in JavaScript is the practice of styling HTML elements.

What is a Temporal Dead Zone?

Select the correct answer

1

A Temporal Dead Zone is the time between variable declaration and variable assignment.

2

A Temporal Dead Zone is the time between variable assignment and variable declaration.

3

A Temporal Dead Zone is the time between scope exit and variable declaration.

4

A Temporal Dead Zone is the time between entering a scope and when the variable is declared.

Explain hoisting.

Select the correct answer

1

Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope.

2

Hoisting is a JavaScript mechanism for styling HTML elements.

3

Hoisting is a server-side technique.

4

Hoisting is a JavaScript mechanism for managing browser cookies.

What is event delegation in JavaScript?

Select the correct answer

1

Event delegation is a technique for handling events where a single event listener is added to a parent element.

2

Event delegation is a method to stop event propagation.

3

Event delegation is used to style HTML elements.

4

Event delegation is a server-side technique.