ALL


  4 asynchronous programming methods in JavaScript

You may know the execution environment of JavaScript is single threaded. The so called single thread means only one task can be running at any time, if there are many tasks, they need to be in a queue and wait for the previous task to be completed.The advantage of this mode is it's easy to implement and the execution environment is relative simple; the disadvantage is that if one task takes long time, the tasks following it must wait in the queue and this will delay other tasks consequently. The end result is the browser may hang.To solve this issue, JavaScript divides the task execution modes...

11,006 0       JAVASCRIPT ASYNCHRONOUS PROGRAMMING EVENT MODEL PROMISE