If I registered a time-consuming callback function to an event listener, and this event is fired twice in a short period. Will the second callback be blocked by the first one?
I tried this in browser:
document.body.onclick = function() {
var date = new Date;
console.log('click event at ' + date);
while(new Date - date < 1e4) {};
console.log('callback end');
}
As the result, the second callback was executed right after the first one is done.
So now I am confusing with the JavaScript non-blocking async module: which part has been executed asynchronously?