title: Why does my JavaScript OR statement not return the correct value?
body: <p>I'm stuck with the following:</p>
  
  <pre><code>foo = properties[field] || overrides.default || config.widget.default || undefined;
  </code></pre>
  
  <p>with</p>
  
  <pre><code>console.log(properties[field])     // undefined
  console.log(overrides.default)     // 0
  console.log(config.widget.default) // undefined
  </code></pre>
  
  <p>So as I understand, <code>foo</code> should be <code>0</code>. Yet... it's <code>undefined</code></p>
  
  <p>This still works:</p>
  
  <pre><code>foo = properties[field] || overrides.default;
  </code></pre>
  
  <p>But as soon as I add another OR option, it does not work anymore.</p>
  
  <p><strong>Question</strong>:<br>
  Why is my 2nd operand with <code>value=0</code> not overriding the <code>undefined</code> operands?</p>
  
  <p>Thanks!</p>