I\'m trying to implement XOR in javascript in the following way:
// XOR validation if ((isEmptyString(firstStr) && !isEmptyString(secondStr)) |
As others have pointed out, logical XOR is the same as not-equal for booleans, so you can do this:
// XOR validation if( isEmptyString(firstStr) != isEmptyString(secondStr) ) { alert(SOME_VALIDATION_MSG); return; }