• The constant function which returns the first passed value.

    Examples

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

    const fn = constant(4);
    assertEquals(fn(3), 4);
    assertEquals(fn("foo"), 4);

    Type Parameters

    • T

    Parameters

    • x: T

    Returns (<U>(_u) => T)

      • <U>(_u): T
      • Type Parameters

        • U

        Parameters

        • _u: U

        Returns T

Generated using TypeDoc