title: How do I check if 2 variables have something in them and the other doesn't?
body: <p>I would like output the values of <code>var1</code>, <code>var2</code> and <code>var3</code> and my code to check if 1 variable exists or not is this:</p>
  
  <pre><code>if (var1){
   return value = "some value -";  
  } else
   return '';  
  }
  </code></pre>
  
  <p>but what if there are 1 or more variable that needs checking like <code>var1</code> exists and <code>var2</code> doesnt etc.,</p>
  
  <pre><code>if (var1 &amp;&amp; !var2 &amp;&amp; var3){
   //do something
  }else if (var1 &amp;&amp; !var2 &amp;&amp; !var3){    
   //do something
  }else
   return '';
  </code></pre>
  
  <p>What am I doing wrong? Basically what I want is to just append a dash on a string so that I can get the output of <code>some value - some value</code> and not get <code>some value -</code> if a variable is empty.</p>