I&#x27;m guessing someone must have resubmitted this link, because it fell off the front page the day or two ago when I posted it myself.<p>This bit of code has several motivations:<p>1) it&#x27;s a pain in the butt to have to put the code for a worker in a separate file sometimes, especially in small demos like on CodePen.<p>2) I don&#x27;t want to have to maintain two different code paths if a particular browser doesn&#x27;t support workers (though even IE does now, so this is likely a dying issue). I don&#x27;t implement fallback checking in this demo, but it would be trivial to do so.<p>2.5) I also don&#x27;t want to have to manually wire up message passing all the time. The messaging port that Worker provides is extremely primitive. It&#x27;s technically only passing a single string!<p>3) It&#x27;s just generally good to decouple long processes from the UI, and no, callbacks don&#x27;t do that. Callbacks provide asynchronicity, not concurrency. This is concurrency, and pretty much at it&#x27;s simplest.<p>4) in the process, I discovered a neat feature: you can run the expensive update on the worker and run a cheaper one that approximates the expected changes over time in the UI in cases where the full update runs much slower than 60fps and give a pretty good illusion of a much higher frame rate. It&#x27;s like network lag compensation for video games, except within your web page.<p>Anyway, hope someone else funds this useful. Check out the editor view on CodePen for the code. It might even be possible to automatically wrap functions that return values in a Promise!