title: Javascript ternary operator shortcut
body: <p>I've tried to search over SE without great success, however link me to the right topic if I'm wrong.<br>
  What I'd like to achieve is use a shortcut of JS's ternary operator, let me explain myself :<br>
  In PHP, you can do something like</p>
  
  <pre><code>&lt;?php 
      $var1 = "1"; //example
      $var2 = ($var1) ?: "2";
      echo $var2 //echoes "1";
  ?&gt;
  </code></pre>
  
  <p>as you can see/may already know, <code>?:</code> returns <code>$var1</code> when if evaluates to "true" (in this case <code>!empty($var1)</code>, or "2" otherwise.<br>
  Now my question is, is there a way do achieve the same thing in Javascript?</p>