Composes two functions mathematically. compose(f)(g)(x) means f(g(x)).
compose(f)(g)(x)
f(g(x))
The function to do at last.
The composed function.
import { assertEquals } from "../deps.ts";import { compose } from "./func.ts";assertEquals(compose((x: number) => x + 1)((x: number) => x * 2)(3), 7); Copy
import { assertEquals } from "../deps.ts";import { compose } from "./func.ts";assertEquals(compose((x: number) => x + 1)((x: number) => x * 2)(3), 7);
Generated using TypeDoc
Composes two functions mathematically.
compose(f)(g)(x)
meansf(g(x))
.