title: Order of evaluation in if statement in Javascript
body: <p>In order to protect my code from accessing undeclared variables I use</p>
  
  <pre><code>if (typeof myVar != 'undefined')
  </code></pre>
  
  <p>This works fine but I'd like to stick another if statement in it. Something like converting this:</p>
  
  <pre><code>if (typeof myVar != 'undefined'){
      if (myVar == "test"){}
  }
  </code></pre>
  
  <p>to this:</p>
  
  <pre><code>if (typeof myVar != 'undefined' &amp;&amp; myVar == "test")
  </code></pre>
  
  <p>Considering <code>myVar</code> may be undefined, is this last code secure in every case of usage and <strong>every browser</strong>? </p>
  
  <p>Is it possible that various statements inside an <code>if ()</code> are not evaluated in the order they're written?</p>
  
  <p>Can I assume <code>myVar == "test"</code> will <strong>never</strong> be executed if <code>myVar</code> is undefined?</p>