title: OR in ternary operator, using &&
body: <p>Using the traditional if statement I can do this:</p>
  
  <pre><code>if(a===0 || b===0) {console.log('aloha amigo')};
  </code></pre>
  
  <p>But when I try to do something the same thing with a ternary operator, like this:</p>
  
  <pre><code>a===0 || b===0 &amp;&amp; console.log('aloha amigo')
  </code></pre>
  
  <p>I just get errors about unexpected ||.</p>
  
  <p>According to this answer: <a href="https://stackoverflow.com/questions/42026158/precedence-logical-or-vs-ternary-operator#42026340">Precedence: Logical or vs. Ternary operator</a>, we can do it using </p>
  
  <pre><code>condition1 || condition2 ? do if true : do if false
  </code></pre>
  
  <p>(Sorry I'm not sure how to call the <code>? :</code> symbols in this case), but I'm not sure how to get it running using <code>&amp;&amp;</code> (It means only run the code if returned <code>true</code>).</p>
  
  <p>I created a codepen to test it easily. Here's the whole code:</p>
  
  <pre><code>var a = 0;
  var b = 1;
  
  a===0 || b===0 ? console.log('Works here') : console.log('And here');
  
  a===0 || b===0 &amp;&amp; console.log('Doesn\'t work here');
  
  a===0 &amp;&amp; console.log('The &amp;&amp; works for a single test');
  </code></pre>
  
  <p><a href="https://codepen.io/Alex-Iron/pen/dKBJXz?editors=1111" rel="noreferrer">Here's the link</a></p>