effect-io-ai

Package: effect
Module: Boolean

Boolean.xor

Combines two booleans using XOR: (!self && that) || (self && !that).

Example

import * as assert from "node:assert"
import { xor } from "effect/Boolean"

assert.deepStrictEqual(xor(true, true), false)
assert.deepStrictEqual(xor(true, false), true)
assert.deepStrictEqual(xor(false, true), true)
assert.deepStrictEqual(xor(false, false), false)

Signature

declare const xor: { (that: boolean): (self: boolean) => boolean; (self: boolean, that: boolean): boolean; }

Source

Since v2.0.0