So while javascript has a single thread to run the main set of functions of the stack it also has Workers https://developer.mozilla.org/en-US/docs/Web/API/Worker, these objects are allowed by the browser to run background tasks like complex math operations.
therefore this tasks will be administrated by the browser taking advantage of the OS to create multiple threads for different tasks.
but this does not allow to reuse the same variables in both contexts unless they are used with the recommended API (as a limitation).
and that's what parallel js takes advantage of.
check the code and search for worker I'm sure it will illustrate you more.
In summary Workers are an API to run multiple processes that interact by methods instead of the usual js chain of code and your code has to be very specific about what to run and with what variables and kind works like promises where you send a task and you wait for the task to return a result sometime in the future .then() you do something else