https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API
Web Workers API - Web APIs | MDN
JS runs single-threaded by default.
Because it runs on a single thread, if you make the main thread do a long-running task, it slows down and the work in progress may not run smoothly. To solve this, you can use async functions or multithreading.
To use multithreading, you can use a Web API called Web Workers.