DEV Community

loading...

Functional Typescript Series

kaanguru profile image cem kaan kosali ・1 min read

Function composition is the process of combining two or more functions to produce a new function. Composing functions together is like snapping together a series of pipes for our data to flow through.

const trim = (s: string) => s.trim();
const capitalize = (s: string) => s.toUpperCase();
Enter fullscreen mode Exit fullscreen mode

Discussion (0)

Forem Open with the Forem app