I have the following scenario:
setTimeout(\"alert(\'this alert is timedout and should be the first\');\", 5000); alert(\"this should be the second one\"); >
Just put it inside the callback:
setTimeout(function() { alert('this alert is timedout and should be the first'); alert('this should be the second one'); }, 5000);