• Get the lowest value of the 2 parameters. Meant to be used with Array.prototype.reduce.

    Time complexity: O(1)

    Space complexity: O(1)

    Type Parameters

    Parameters

    • accumulator: A
    • currentValue: B

      The next value to compare

    Returns A | B

    previousValue or currentValue, whichever is lower

    Reducers

    const array = [1, 2, 3];

    array.reduce(min); // 1