title: Cleanest way to assign with short circuit evaluation on multiple conditions
body: <p>I am trying to build a JSON object based on data that the client has on hand.</p>
  <p>Ideally, it would select address data if available, then cart data if not available, otherwise null.</p>
  <p>Here the data is retrieved from localStorage, but I run into issues, <code>addresses</code> and <code>cart</code> resolve the following errors when <code>null</code>.</p>
  <blockquote>
  <p>Cannot read property 'length' of null</p>
  <p>Cannot read property 'idShipTo' of undefined</p>
  </blockquote>
  <pre><code>let cart = JSON.parse(localStorage.getItem('shopping-cart'));
  let addresses = JSON.parse(localStorage.getItem('customer-address'));
  
  this.request = {
    address: {
      shipToAddLine: addresses[0].shipToAddLine || cart.shipToAddLine || null,
      shipToCityStZip: addresses[0].shipToCityStZip || cart.shipToCityStZip || null
    }
  }
  </code></pre>
  <p>I'd like to use something like the ternary operator, but use more than one if / else value.</p>
  <pre><code>this.request = {
    address: {
      shipToAddLine: (addresses) ? addresses[0].shipToAddLine || (cart) ? cart.shipToAddLine || null,
      shipToCityStZip: (addresses) ? addresses[0].shipToCityStZip || (cart) ? cart.shipToCityStZip || null
    }
  }
  </code></pre>
  <p>Is this possible using a clean (one-line) syntax in JS, or do I have to put the assignments in if / else  blocks?</p>
  <pre><code>let shipToAddLine;
  if (addresses) shipToAddLine = addresses[0].shipToAddLine;
  else if (cart) shipToAddLine = cart.shipToCityStZip;
  else shipToAddLine = null;
  </code></pre>
  <p>etc...</p>