title: Using the same if else statement with two variables
body: <p>I have the following if statement:</p>
  
  <pre><code>let panoX = 0
  if (pano.x === 0) {
    panoX = 0
  } else if (pano.x === null) {
    panoX = 200
  } else {
    panoX = pano.x
  }
  
  // This will be sent in a form
  {
    x: panoX,
    y: panoY
  }
  </code></pre>
  
  <p>It sets <code>panoX</code> based on the value of <code>pano.x</code>. But I also have a <code>pano.y</code>, that goes through the same if statement. How can I deal with <code>pano.y</code> without having to write a new if statement? </p>
  
  <p>(Note: I can't do <code>x: pano.x || 200</code> because <code>0</code> is falsy in JavaScript. So setting <code>pano.x</code> to <code>0</code> makes <code>x:</code> be <code>200</code>.</p>