36.4.2. How can we avoid blocking the browser?
The dividePromise() we are calling in line A is the same Promise-based function from the previous section. But we now have synchronous-looking syntax for making the call. await can only be used inside a special kind of function, an async function (note the keyword async in front of the keyword function). await pauses the current async function and returns from it. Once the awaited result is ready, the execution of the function continues where it left off.
Figure 20: Task sources add code to run to the task queue, which is emptied by the event loop.
Perform long computations in separate processes: This can be done via so-called Web Workers. Web Workers are heavyweight processes that run concurrently to the main process. Each one of them has its own runtime environment (global variables etc.). They are completely isolated and must be communicated with via message passing. Consult MDN web docs for more information.