The example in promises.html shows problem with the sync javascript. It blocks the code until it finishes the code that is currently in process by the main thread as Javascript is a single threaded language
To solve this problem we can use web workers or most modern we can use Async JS
Async code allows the program to run immediately without blocking any other code that is being executed currently by the main thread.
A typical example will be serTimeout