• The identity function which returns the passed value as is.

    Examples

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

    assertEquals(id(2), 2);
    assertEquals(id("foo"), "foo");

    Type Parameters

    • T

    Parameters

    • x: T

    Returns T

Generated using TypeDoc