title: XOR operator in Javascript to check against value
body: <p>So, as far as I checked, there is no XOR operator for javascript.</p>
  
  <p>There is tho the following -</p>
  
  <p><code>if( ( foo &amp;&amp; !bar ) || ( !foo &amp;&amp; bar ) ) {
    ...
  }
  </code></p>
  
  <p>This is clear if foo and bar are boolean values. But can XOR be used to check against a different type of expression? For example if I would like to check a value against another value, that is -</p>
  
  <p><code>if (type === 'configuration' XOR type2 === 'setup') {
  ...
  }
  </code></p>
  
  <p>Would it transform to something like -</p>
  
  <p><code>if ( (type === 'configuration' &amp;&amp; type2 !== 'setup') || (type !== 'configuration' &amp;&amp; type2 === 'setup' ) ) {
  ...
  }
  </code>
  Or would it look different?</p>
  
  <p>This gives the following result -</p>
  
  <p><code>type = 'configuration' &amp;&amp; type2 = 'setup': false
  type = 'configurations' &amp;&amp; type2 = 'setup': true
  type = 'configuration' &amp;&amp; type2 = 'setups': true
  type = 'configurations' &amp;&amp; type2 = 'setups': false</code></p>
  
  <p>Which matches the </p>
  
  <p><code>0 XOR 0 = 0
  0 XOR 1 = 1
  1 XOR 0 = 1
  1 XOR 1 = 0</code></p>
  
  <p>but I'm not sure if this will match for all cases.</p>