Why is there no logical xor in JavaScript?
Try this short and easy to understand one
function xor(x,y){return true==(x!==y);} function xnor(x,y){return !xor(x,y);}
This will work for any data type