Function flip

  • Creates a function that invokes func with arguments reversed.

    Type Parameters

    • T extends AnyFunction

    Parameters

    • func: T

      The function to flip arguments for.

    Returns T

    Returns the new flipped function.

    4.0.0

    reverse

    const flipped = flip((...args) => args)

    flipped('a', 'b', 'c', 'd')
    // => ['d', 'c', 'b', 'a']