logical-xor

0.1.1 • Public • Published

logical-xor

Exclusive or, which returns true only when the inputs differ.

install

npm install logical-xor

usage

Pass in 1 parameter, and it evaluates the truthiness of it.

Pass in 2 parameters, and it returns true only if the inputs evaluate to different booleans.

Pass in more than 2 and it will walk down the chain, left to right, evaluating each set as it goes.

const xor = require('logical-xor');
 
xor(true, true) // returns false
xor(true, false) // returns true
xor(true) // returns true
xor(true, true, true, false) // return true

tests

npm test

Package Sidebar

Install

npm i logical-xor

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • jacobemerick