• Flips two arguments of the function.

    Type Parameters

    • T

    • U

    • V

    Parameters

    • f: Fn<T, Fn<U, V>>

      The function with two arguments.

    Returns Fn<U, Fn<T, V>>

    The function flipped the arguments.

    Examples

    import { assertEquals } from "../deps.ts";
    import { flip } from "./func.ts";

    const fn = flip((a: string) => (b: string) => a + b);
    assertEquals(fn("a")("b"), "ba");
    assertEquals(fn("asd")("btg"), "btgasd");

Generated using TypeDoc