UNPKG

101

Version:

common javascript utils that can be required selectively that assume es5+

18 lines (14 loc) 248 B
/** * @module 101/xor */ /** * Exclusive or * @function module:101/xor * @param {*} a - any value * @param {*} b - any value * @return {boolean} a xor b */ module.exports = xor; function xor (a, b) { return !(!a && !b) && !(a && b); }