Understanding JavaScript Timers « JavaScript, JavaScript - 1 views
-
By enforcing a timeout (however small) you remove the function from the current execution queue and hold it back until the browser is not busy.
-
you can make long running functions (on which no other immediate function is dependent) defer execution until more urgent routines have completed.
-
The firing of the setTimeout callback is asynchronous, the function itself will be invoked in line and after the current invocation queue