Logic

Methods

(static) and(argumentOne, argumentTwo) → {Boolean}

Source:
Since:
  • 0.1.0

A function that returns true if any of provided arguments is truthy. Otherwise false.

Example
and(true, true); // => true
and(true, false); // => false
and(); // => false
Parameters:
Name Type Description
argumentOne *
argumentTwo *
Returns:

Result of logical and between two arguments.

Type
Boolean

(static) not(arg) → {Boolean}

Source:
Since:
  • 0.1.0

A function that returns the ! of its argument. It will return true when passed false-y value, and false when passed a truth-y one.

Example
not(true); // => false
not(0); // => true
Parameters:
Name Type Description
arg *

Value to coerce.

Returns:

Boolean representation of negated value.

Type
Boolean

(static) or(argumentOne, argumentTwo) → {Boolean}

Source:
Since:
  • 0.1.0

A function that returns true if any of the provided arguments is truthy.

Example
or(true, true); // => true
or(true, false); // => true
or(false, false); // => false
Parameters:
Name Type Description
argumentOne *
argumentTwo *
Returns:
Type
Boolean

(static) xor(argumentOne, argumentTwo) → {Boolean}

Source:
Since:
  • 0.1.0

A function that returns true if only one of arguments is true. Otherwise false.

Example
xor(true, true); // => false
xor(true, false); // => true
xor(false, false); // => false
Parameters:
Name Type Description
argumentOne *
argumentTwo *
Returns:
Type
Boolean