What Is a Web Worker?
A web worker is a browser thread that executes a script in the background, isolated from the page's main thread. It cannot touch the DOM directly and exchanges data with the page through message passing. Workers let CPU-heavy tasks run without blocking rendering or user input.
Why it matters
JavaScript on the main thread shares time with rendering and input handling, so a long computation stalls the UI. Moving that work to a web worker keeps the interface responsive.
Related guides
What Is a Shared Worker?A shared worker is a background thread that multiple browser tabs or windows from the same origin can connect…
What Is a Service Worker Cache?A service worker cache is a programmable store that a service worker uses to intercept requests and serve res…
What Is a Dynamic Import?A dynamic import loads a JavaScript module on demand at runtime, returning a promise, which enables code spli…