title: indexOf always returning true for document.location
body: <p>I have the following script:</p>
  
  <pre><code>if (window.location.href.indexOf('env=P')) {      
    env = 'P';
    console.log("P");
  } else {
    env = 'A';
    console.log("A");
  }   
  </code></pre>
  
  <p>env is always equal to P no matter what the url is.  I am quite sure I have used indexOf before for uri's but am not sure the issue here.</p>