Loading
A background helper that does heavy work without freezing the page — like a kitchen assistant who chops vegetables while the chef cooks.
A browser API that runs JavaScript in a separate thread, communicating with the main thread via postMessage. Workers cannot access the DOM but can perform CPU-intensive tasks without blocking UI rendering.
Dedicated Workers execute in an isolated global scope (DedicatedWorkerGlobalScope) with its own event loop. Data is passed via the structured clone algorithm or, for zero-copy, Transferable objects (ArrayBuffer, MessagePort, OffscreenCanvas). SharedArrayBuffer enables lock-free concurrent memory access when combined with Atomics, but requires cross-origin isolation headers (COOP/COEP).