Local Web Worker
Under normal circumstances, a Web Worker should be passed a URL of the script to execute. However, a local function can also be used
This is done by converting a function to a string, converting that string to a Blob, and converting that Blob to an Object URL.
The code to do this would look a bit like this:
Be aware that the workerCode does not share the scope with its parent!
As it is a separate script, it also has no
This codepen demonstrates how a Web Worker can be used without a remote URL: https://codepen.io/potherca/full/OJxbmMj