Same way that python does parallelism, by relying on the underlying OS to schedule threads and use multiple cores.
For JS running in browser, you probably don't want any allowance for such scheduling in the scripts, and let the JS engine in the browser automatically establish parallelism if needed.