title: Why does setting window.location.href not stop script execution
body: <p>The following code changes the location to www.bing.com regardless of wether redirect is 1 or any other number. If redirect is 1, it logs "is redirecting" and then redirects to www.bing.com. My best guess is that when href is set a change-event is triggered, but it takes some ticks before it executes. Meanwhilethe first line of code after is still executed. Or? do anyone what happens?</p>
  
  <pre><code>if (redirect == 1) {
      console.log("is redirecting");
      window.location.href = "http://www.google.com";
  }
  
  window.location.href = "http://www.bing.com";
  </code></pre>