var loop = true,
block = setTimeout(function(){loop = false}, 1);
while(loop);
It's a deadlock, because while loop is waiting that condition is setted to false while timeout, the one who'll set that condition to false, is waiting while loop end to be executed.
THe same behaviour is expected with Ajax or every other async interaction.
This is JavaScript, have fun :-)
No comments:
Post a Comment