title: JavaScript Short-Circuit Still Throws Undefined Error
body: <p>I'm working with some older code in AngularJs.  There's a variable <code>someVar1</code> that could possibly exist in the JS ether and if it does, I wanted to attach it to my scope like so:</p>
  
  <pre><code>$scope.someVar2 = someVar1 || 0;
  </code></pre>
  
  <p>But occasionally, when <code>someVar1</code> doesn't exist in the ether, I get this error:</p>
  
  <p><em>Error: someVar1 is not defined</em></p>
  
  <p>It points directly to the line and column of <code>someVar1</code> in the JS file.</p>
  
  <p>Why is this happening?  I was under the impression that <code>someVar1 || 0</code> would check if <code>someVar1</code> was undefined, which is falsy, and set the <code>$scope.someVar2</code> to 0.</p>