In JavaScript, when a thread executes without relying on other threads to process it, we call it asynchronous, and the other thread must wait until another thread finishes processing, which we call synchronization.
To make an analogy:
(1) Synchronization is when you boil instant noodles must wait for the water to open, you will put spices and instant noodles;
(2) asynchronous is when you boil instant noodles do not need to wait for water to open, you can just start firing, put spices and instant noodles;
In JS synchronous asynchronous and blocking non-blocking in fact there is no essential difference, we often refer to the same thing, because JS is single-threaded.
But JS execution environment is multi-threaded, want to achieve blocking effect, can be synchronized or alert ()
In the background system, the background system menu is based on the rights of the user to assign the user's menu interface, this time need to use the synchronous Blocking feature to this menu interface, and this synchronization JS needs to be written before the body.
Synchronous vs. asynchronous in JavaScript