I am trying to understand the execution priority of Javascript. I have a code where a timer runs to callback a function after 15 seconds. However, an event might occur just before that and the even handler function may be called.
clearTimeout(theTimerThatJustWentOff)
? Will the timer service routine run after we exit the event handler?I am not asking what happens in a race condition of two asynchronous events. In my case, one has occurred and is being serviced while the second occurs.
Javascript runs single-threaded. That should answer your questions. So