locutus
Version:
Locutus other languages' standard libraries to JavaScript for fun and educational purposes
16 lines (15 loc) • 612 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.xor = xor;
const _operator_ts_1 = require("../_helpers/_operator.js");
function xor(a, b) {
// discuss at: https://locutus.io/python/operator/xor/
// parity verified: Python 3.12
// original by: Kevin van Zonneveld (https://kvz.io)
// note 1: Performs Python-style bitwise xor on integer-like values.
// example 1: xor(7, 10)
// returns 1: 13
// example 2: xor(true, false)
// returns 2: true
return (0, _operator_ts_1.pythonBitXor)(a, b, 'xor');
}