title: Is there anyway to implement XOR in javascript
body: <p>I'm trying to implement XOR in javascript in the following way:</p>
  
  <pre><code>   // XOR validation
     if ((isEmptyString(firstStr) &amp;&amp; !isEmptyString(secondStr)) ||
      (!isEmptyString(firstStr) &amp;&amp; isEmptyString(secondStr))
     {
      alert(SOME_VALIDATION_MSG);
      return;
     }
  </code></pre>
  
  <p>Is there a better way to do this in javascript?</p>
  
  <p>Thanks.</p>