Web workers allow you to offload intensive code to a background thread, keeping the UI thread clear. Click the start button. Notice how the browser tab remains responsive. The DOM can be freely updated to show progress while the intensive code runs.

1 2 3 4 5

Blog post: Multi-Threaded JavaScript with Web Workers