BiOperator<T>: BiFunction<T, T, T>

Type of function that takes two values of type T and returns a value of type T.

Type Parameters

  • T

    The type of the input to the function

Example: A bi-operator can be a function that represents binary operations such as addition,

subtraction, multiplication, etc.
const add: BiOperator<number> = (a, b) => a + b;
const subtract: BiOperator<number> = (a, b) => a - b;
const multiply: BiOperator<number> = (a, b) => a * b;
const divide: BiOperator<number> = (a, b) => a / b;
const modulo: BiOperator<number> = (a, b) => a % b;
const power: BiOperator<number> = (a, b) => a ** b;

Generated using TypeDoc