Web workers, Service workers, and worklets all run scripts in separate threads outside the main thread of the browser, and the difference between them is the scenarios they apply and their features.

Worklet

The Worklet is a hook in the browser rendering stream that allows us to have low-level permissions in the browser rendering thread, such as styles and layouts.

Service worker

The Service worker is a proxy between the browser and the network. By intercepting requests made in documents, the service worker can directly request data in the cache to run offline.

Web worker

Web workers are scripts that are generally intended to let us reduce the intensive processing in the main thread.