Which of the following best describes a Web Worker?

Learn web design with our comprehensive test guide. Improve your skills with flashcards and multiple choice questions. Each question includes hints and explanations. Get ready to ace your exam!

Multiple Choice

Which of the following best describes a Web Worker?

Explanation:
Web Workers are separate JavaScript execution contexts that run in the background on a different thread from the main page. This lets you perform CPU-heavy tasks without blocking the UI, so the page stays responsive while the work continues. In practice, a worker handles calculations or data processing and communicates with the main thread via message passing, since it can’t directly access the DOM or the window object. This fits best with the description of JavaScript running in the background, without affecting the page’s performance. The other options describe unrelated features or attributes, so they don’t capture what a Web Worker does.

Web Workers are separate JavaScript execution contexts that run in the background on a different thread from the main page. This lets you perform CPU-heavy tasks without blocking the UI, so the page stays responsive while the work continues. In practice, a worker handles calculations or data processing and communicates with the main thread via message passing, since it can’t directly access the DOM or the window object. This fits best with the description of JavaScript running in the background, without affecting the page’s performance. The other options describe unrelated features or attributes, so they don’t capture what a Web Worker does.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy