title: ReactJS: Logic Operator
body: <p>I have</p>
  <pre><code>var weightpref = naa?.WeightPref == true || naa.WeightPref == undefined ? 'kg' : 'lb'
  </code></pre>
  <p>So basically if naa (an array) has WeightPref set to true or if the field does not exist then it should show kg otherwise show lb.</p>
  <p>It doesn't seem to look at the undefined at all. So while I can get it working for simple true/false am also trying to build logic in for if the field hasn't actually been set yet.</p>