An Introduction to Web Workers
What is this article about?
To run tasks that take a long time to complete, we need a way to run them in the background. Web workers are the way to do that. They live in their own context within the browser. Therefore, they don’t have access to the DOM and have their own global variable, self
.
A web worker can’t access the window
object, but we still use many things that are parts of it like WebSockets and IndexedDB.
Read More.