Why is there no logical xor in JavaScript?
Check out:
You can mimic it something like this:
if( ( foo && !bar ) || ( !foo && bar ) ) { ... }