title: Combining the logic of two if statements
body: <p>Is there a way to make the following JavaScript if..else condition short, instead of writing <code>if() else()</code> function two times is there any way to write <code>if(x,y = ""){} else{}</code> or something similar to make it shorter ?</p>
  
  <pre><code>$(document).ready(function(){
      $("#third").click(function(){
          var xxx = $("#first").val();
          var xxy = $("#second").val();
  
          if (xxx == "") {
              alert("good"); 
          }
          else {
              alert("bad"); 
          }
  
          if (xxy == "") {
              alert("good"); 
          }
          else {
              alert("bad"); 
          }
      });
  });
  </code></pre>