I have the following javascript redirect code followed by some more code.
window.location.href = \'/someurl\';
alert(\'hello\');
alert(\'hello again\');
The browser will try to execute the code after window.location.href = 'url'
until the page goes to the next web adress, so the number of lines of code that will be executed depends on the browser's speed
The Javascript session will struggle to continue it's mission in the face of impending doom. Coding in this manner is considered unpredictable. ...and cruel.