title: Why do these ternary expressions give different results?
body: <p>My first reduce returns an expression of the form:
  <code>a + (condition)? b : c</code>, and my second reduce returns the equivalent (???) expression: <code>(condition)? a+b : a+c</code>  Why do they behave differently?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function addressLengthWrong(address) {
    let keys = ['street', 'city', 'state', 'zip']
    return keys.reduce((acc, key) =&gt; acc + (address[key]) ? address[key].length : 0, 0)
  }
  
  let address = {
    street: 'My Street',
    city: '',
    state: '',
    zip: ''
  }
  console.log(`wrong address len ${addressLengthWrong(address)}`)
  
  address.zip = '01234'
  console.log(`wrong address len ${addressLengthWrong(address)}`)</code></pre>
  </div>
  </div>
  </p>
  
  <p>Running the alternative...</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function addressLengthCorrect(address) {
    let keys = ['street', 'city', 'state', 'zip']
    return keys.reduce((acc, key) =&gt; (address[key]) ? acc + address[key].length : acc, 0)
  
  }
  
  address = {
    street: 'My Street',
    city: '',
    state: '',
    zip: ''
  }
  console.log(`correct address len ${addressLengthCorrect(address)}`)
  
  address.zip = '01234'
  console.log(`correct address len ${addressLengthCorrect(address)}`)</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have the excited sense that I'm about to learn something new.  What's going on here?</p>