posted 16 years ago
If I have a function with a setTimeout of 20 seconds and then statements afterwards. It will continue to process the statements after the setTimeout and then go to the statements in the setTimout call. What is the flow of the code to be expected? Once the 20 seconds gets hit do the statements after the setTimeout continue and then the ones in setTimeout, do the statements stop being processed after the setTimeout then the ones in the setTimeout and back to where it left off, etc..,? Is there a way to say process everything inline and not continue onward? It's fairly easy to get around it but knowing what exactly is going on and how to prevent it would be very helpful and much appreciated. Thanks.
Rob