The constant function which returns the first passed value.
import { assertEquals } from "../deps.ts";import { constant } from "./func.ts";const fn = constant(4);assertEquals(fn(3), 4);assertEquals(fn("foo"), 4); Copy
import { assertEquals } from "../deps.ts";import { constant } from "./func.ts";const fn = constant(4);assertEquals(fn(3), 4);assertEquals(fn("foo"), 4);
Generated using TypeDoc
The constant function which returns the first passed value.
Examples